Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2011, 03:47 AM
shabbaranks shabbaranks is offline Creating macro to convert/print to pdf Windows 7 64bit Creating macro to convert/print to pdf Office 2007
Advanced Beginner
Creating macro to convert/print to pdf
 
Join Date: Mar 2011
Posts: 89
shabbaranks is on a distinguished road
Default Creating macro to convert/print to pdf

Hi all,

I could do with some help please.. I understand you can print/save as PDF within Word 2007 but the file location seems to revert to my documents etc.

Is it possible (and some pointers would be appreciated) to create a macro which uses the save/print pdf funtion and save it in the same location as where the original document was opened from?



Thanks in advance
Reply With Quote
  #2  
Old 05-18-2011, 05:51 AM
macropod's Avatar
macropod macropod is offline Creating macro to convert/print to pdf Windows 7 32bit Creating macro to convert/print to pdf Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That's not the behaviour I see - the default save location for creating a PDF via File|Save As (using Word's PDF/XPS option) is the folder from which the document was opened.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-18-2011, 06:54 AM
shabbaranks shabbaranks is offline Creating macro to convert/print to pdf Windows 7 64bit Creating macro to convert/print to pdf Office 2007
Advanced Beginner
Creating macro to convert/print to pdf
 
Join Date: Mar 2011
Posts: 89
shabbaranks is on a distinguished road
Default

Ive opened a range of documents and some save as pdf in the location the doc is and others defualt to document libraries. Im guessing it is possible to create a macro to do as I require?

Thanks
Reply With Quote
  #4  
Old 05-18-2011, 08:59 AM
shabbaranks shabbaranks is offline Creating macro to convert/print to pdf Windows 7 64bit Creating macro to convert/print to pdf Office 2007
Advanced Beginner
Creating macro to convert/print to pdf
 
Join Date: Mar 2011
Posts: 89
shabbaranks is on a distinguished road
Default

Created the macro to print to pdf:

Sub Word2PDF()
'
' Word2PDF Macro
'
'
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
ActiveDocument.Path & "\" & ActiveDocument.Name & ".pdf", ExportFormat:= _
wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, _
item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
End Sub

Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating macro to convert/print to pdf creating macro for biffurcation in sheets according to data. Nirik Excel Programming 8 05-07-2011 05:11 AM
Creating macro to convert/print to pdf Macro for Print sivakl2001 Word VBA 6 03-24-2011 11:25 PM
Creating a MACRO Nikb3522 Word VBA 0 10-21-2010 05:55 PM
Print Macro in MS Word steve207 Word VBA 0 09-10-2010 02:11 AM
creating macro steveb Word VBA 0 08-14-2010 01:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:13 AM.


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