Saturday 15 March 2014

Why does Word VBA tell me that a dialog box is open? -



Why does Word VBA tell me that a dialog box is open? -

i'm trying re-create selection new document , export pdf, i'm getting error cannot resolve.

on line activewindow.close false i'm beingness told

run-time error '5479': cannot close microsoft word because dialog box open. click ok, switch word , close dialog box.

unless export pdf operation firing dialog, not know dialog open.

can please shed light? thanks.

'** re-create selection *' selection.copy '** create new document paste copied text *' documents.add template:="normal", newtemplate:=false, documenttype:=0 '** paste copied text *' selection.pasteandformat (wdusedestinationstylesrecovery) '** alter location of file open directory *' changefileopendirectory opendirectory '** export document pdf *' activedocument.exportasfixedformat outputfilename:= _ opendirectory & "\zenworks.pdf", exportformat:= _ wdexportformatpdf, openafterexport:=true, optimizefor:= _ wdexportoptimizeforprint, range:=wdexportalldocument, from:=1, to:=1, _ item:=wdexportdocumentcontent, includedocprops:=true, keepirm:=true, _ createbookmarks:=wdexportcreatenobookmarks, docstructuretags:=true, _ bitmapmissingfonts:=true, useiso19005_1:=false '** close new document *' activewindow.close false copytonewdocument = true

shouldn't activedocument.close instead of activewindow?

vba word-vba word-2010

No comments:

Post a Comment