View Single Post
 
Old 06-07-2017, 10:27 AM
ekimisme ekimisme is offline Windows XP Office 2010 32bit
Novice
 
Join Date: Jun 2017
Posts: 1
ekimisme is on a distinguished road
Default Help with Macro to Save Word File as PDF in Specific Location

Hi all,

I am trying to create a macro that automatically saves a word file from Word 2010 as a PDF to my desktop without any popups or further prompts.

The problem is that my work computer is constantly saving documents to different locations (even though my default save location is the desktop), so if the macro does not specify a folder, the PDF will go to whatever the last used folder was. What I have below works for creating the PDF, but not the location. The location I want is "C:\Users\XMMS\Desktop\". Any suggestions how I can upgrade my Macro below to get the right location every time?

Sub Print1()
'
' Silent Save_to_PDF Macro
'
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
Replace(ActiveDocument.FullName, ".docx", ".pdf"), _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, Item:= _
wdExportDocumentContent, IncludeDocProps:=False, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
'
End Sub



Thanks!!
Reply With Quote