View Single Post
 
Old 05-19-2011, 04:08 AM
shabbaranks shabbaranks is offline Windows 7 64bit Office 2007
Advanced Beginner
 
Join Date: Mar 2011
Posts: 89
shabbaranks is on a distinguished road
Default Macro to save as PDF but with a different name

Hi all...

I posted a solution for a macro which saves as a pdf as below:
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

But I would like to be able to save with a different file name - can anyone suggest how I do this? Basically if I have a word doc named temp.docx it creates a pdf with the name temp.docx.pdf and I would like to remove the .docx extension.

Thanks!
Reply With Quote