View Single Post
 
Old 06-02-2014, 06:37 AM
OTPM OTPM is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
First save your document as a macro enabled document.
Next click on the Developer tab followed by Visual Basic.
Next on the left hand side click on ThisDocument and past the following code:

Code:
Private Sub Document_Close()
 ActiveDocument.Save
    ActiveDocument.ExportAsFixedFormat OutputFileName:= _
        "D:\Users\anking\Desktop\Menu Test to save as PDF.pdf", ExportFormat:= _
        wdExportFormatPDF, OpenAfterExport:=Fasle, OptimizeFor:= _
        wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
        Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
        CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
        BitmapMissingFonts:=True, UseISO19005_1:=False
    ShowVisualBasicEditor = True
End Sub
Change the document path to suit your needs. A pdf version of the filw will then be created automatically when you close the document.
Hope this helps.
Tony
Reply With Quote