save word doc as pdf (1 Viewer)

deekras

Registered User.
Local time
Today, 10:10
Joined
Jun 14, 2000
Messages
169
i would like to run through my database and
merge in a word 2007 document (several page .docx)
save that word document as pdf
(do that for several word documents)
zip all pdfs
email

i have the code for the loop and the merge and email. works well. I am stuck on the save as pdf and zip all pdfs.

i tried
objWord.ActiveDocument.ExportAsFixedFormat OutputFileName:= _
strFileName, ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=False, OptimizeFor:=wdExportOptimizeForPrint, Range:= _
wdExportAllDocument, From:=1, To:=1, Item:=wdExportDocumentWithMarkup, _
IncludeDocProps:=True, KeepIRM:=True, CreateBookmarks:= _
wdExportCreateNoBookmarks, DocStructureTags:=True, BitmapMissingFonts:= _
True, UseISO19005_1:=True

I get an error. I can save as PDF from within Word. I did download the addin.

and i can't even think of what to do about zipping the files

thanks
 

alktrigger

Aimless Extraordinaire
Local time
Today, 05:10
Joined
Jun 9, 2009
Messages
124
i pulled the following from a macro in word, you might need to adapt file location and the Active document part

Code:
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
        "C:\Documents and Settings\My Documents\Doc1.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
 

deekras

Registered User.
Local time
Today, 10:10
Joined
Jun 14, 2000
Messages
169
i tried. i changed the doc name. i reviewed all the parameters. i get an error. "object doesn't support this property or method".
 

Users who are viewing this thread

Top Bottom