Trying to get this right... ExportAsFixedFormat does not work...
file = "C:\temp\testdom.docx"
App = ObjectOpen("Word.Application")
Docs = App.Documents
Doc = Docs.Open(file)
Doc.ExportAsFixedFormat(::OutputFileName="C:\temp\testdom.pdf", ExportFormat=wdExportFormatPDF, OpenAfterExport=False)
Doc.Close()
App.Quit()
ObjectClose(Doc)
ObjectClose(Docs)
ObjectClose(App)
pause("Word Convert", "Complete")
exit
Actual Word Macro shows this:
Sub Macro1()
'
' Macro1 Macro
'
'
ActiveDocument.ExportAsFixedFormat OutputFileName:="C:\temp\testdom.pdf", _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
ChangeFileOpenDirectory "C:\temp\"
End Sub
any suggestions?, thanks!
Just a quick guess but...
has wdExportFormatPDF been previously assigned in your script
might want to use @FALSE
you are correct, I have not.
I don't know what wdExportFormatPDF should be.
I will try to find out...
ok, looks like wdExportFormatPDF = 17
but still fails, must be some syntax issue?
Oh, actually getting an 'Assignment not legal here. (Use == for equality testing) here
-->Doc.ExportAsFixedFormat(OutputFileName="C:\temp\testdom.pdf", ExportFormat=wdExportFormatPDF, OpenAfterExport=TRUE)
...hmmm
OK, this line worked to save!
Doc.SaveAs("C:\temp\testdom.pdf",wdExportFormatPDF)
duh!