Save-As PDF

G

Gil Sudai

Using Word 2007 and the save-as pdf addin.
I'm looking for a VBA way to save-as current document as pdf, in the current
folder and current file name, and to control the pdf addin options,
especially to uncheck the 'bitmap text when fonts may not be embedded' option.
 
D

DaveLett

You can use the following macro (recorded):
ActiveDocument.ExportAsFixedFormat _
OutputFileName:=Replace(Replace(ActiveDocument.FullName,
".docx", ".pdf"), ".doc", ".pdf"), _
ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=False, _
OptimizeFor:=wdExportOptimizeForOnScreen, _
Range:=wdExportAllDocument, From:=1, To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, _
KeepIRM:=True, CreateBookmarks:=wdExportCreateHeadingBookmarks, _
DocStructureTags:=True, BitmapMissingFonts:=False,
UseISO19005_1:=False


You can also use the following to do the same for all open documents:

Dim oDoc As Document
For Each oDoc In Documents
With oDoc
.Activate
.ExportAsFixedFormat _
OutputFileName:=Replace(Replace(oDoc.FullName, ".docx", ".pdf"),
".doc", ".pdf"), _
ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=False, _
OptimizeFor:=wdExportOptimizeForOnScreen, _
Range:=wdExportAllDocument, From:=1, To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, _
KeepIRM:=True, CreateBookmarks:=wdExportCreateHeadingBookmarks, _
DocStructureTags:=True, BitmapMissingFonts:=False,
UseISO19005_1:=False
End With
Next oDoc

HTH,
Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top