Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-03-2019, 05:20 PM
macropod's Avatar
macropod macropod is offline Insert variable in path name Windows 7 64bit Insert variable in path name Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,536
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

Is there a reason for not using SaveAs, or the FileSave dialogue? That said, you could use:
Code:
Dim StrNm As String
StrNm = InputBox("PDF File Name")
StrNm = "P:\My Documents\Excel\Stock Information\Good Files\PDF\" & StrNm & ".pdf"
ActiveDocument.ExportAsFixedFormat OutputFileName:=StrNm, _
  ExportFormat:=wdExportFormatPDF, OpenAfterExport:=True, _
  OptimizeFor:=wdExportOptimizeForPrint, Range:=wdExportAllDocument, _
  Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
  CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
  BitmapMissingFonts:=True, UseISO19005_1:=False
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert variable in path name VBA to Insert variable rows based on a data in active cell Marcia Excel Programming 4 07-28-2018 10:02 AM
Insert variable in path name Insert a Variable Row to SUM SubTotal ChrisOK Excel Programming 3 02-12-2018 10:46 AM
I want to create a bar chart of multiple variable. Then I need to draw trend lin of those variable shimulsiddiquee Excel 1 05-16-2017 07:39 AM
Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge Berryblue Mail Merge 1 11-13-2014 05:36 PM
Insert variable in path name insert auto path & file name in ppt 2013 rideninc PowerPoint 1 01-28-2014 05:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:36 AM.


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