Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-02-2014, 06:37 AM
OTPM OTPM is offline Automatically generate PDF from saved word doc Windows 7 32bit Automatically generate PDF from saved word doc 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to uninstall, then install Office 2007. Is data in Outlook automatically saved? jgenn Office 1 03-10-2014 02:14 PM
Video not working when saved as .ppt But does when saved as .pptx patientxwolf PowerPoint 5 01-24-2014 02:16 PM
Word 2013 macro to generate last day of each week (Saturday) CrabApple Word 1 11-08-2013 02:40 PM
Using Word/OL 2010 to generate personalized email messages rickr44318 Word 0 06-26-2013 06:34 AM
How to identify whether Word 2007 was used to create a document saved as Word 2003 noviceatwork Word 0 03-08-2012 06:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft