View Single Post
 
Old 09-17-2014, 10:35 AM
rjrichar40 rjrichar40 is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Aug 2014
Posts: 11
rjrichar40 is on a distinguished road
Default Export to PDF and also append additional Docs

Howdy folks,

I have some code to create a PDF from a word doc. Pretty easy stuff. The problems I am running into are:

1) how can I append additional Word doc files to an existing PDF? Or, have several Docs selected, and merge them into one PDF?

2) in VBA, can I assign permissions such as Read-Only and text not allowed to be copied?

The code I have tried so far is below, but I don't see options for the above. Any thoughts are welcome! (I should add that I can't use 3rd party software for this... just Word 2010 and inherent PDF ability).

2 variations of the same thing, basically:
WdDoc.ExportAsFixedFormat OutputFileName:=StrFilePath, ExportFormat:=wdExportFormatPDF, OpenAfterExport:=True, OptimizeFor:=wdExportOptimizeForPrint, Range:=wdExportAllDocument, Item:=wdExportDocumentContent, IncludeDocProps:=True

ActiveDocument.SaveAs2 Replace(ActiveDocument.FullName, ActiveDocument.Name, "") + Mid(ActiveDocument.Name, 1, InStr(1, ActiveDocument.Name, ".") - 1) + ".pdf", Word.WdSaveFormat.wdFormatPDF
Reply With Quote