Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-29-2014, 08:13 AM
mbesspiata mbesspiata is offline Save as File Windows 7 64bit Save as File Office 2010 64bit
Advanced Beginner
Save as File
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Unhappy Save as File

I have this current VBA code to save a file as pdf but with a specific file name. How can I change this to it asks me to select the file name to "save as"?
Here is my current vba:
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
"C:\Users\mbesspiata\Desktop\Dayton Countsheet File.pdf", ExportFormat:= _
wdExportFormatPDF, OpenAfterExport:=True, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _


Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False

How can I make me ask for the file?
thanks

Mike
Reply With Quote
  #2  
Old 05-29-2014, 09:59 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Save as File Windows 7 64bit Save as File Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 3,907
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

You can make use of code to display the Save As dialog box:

Code:
Dialogs(wdDialogFileSaveAs).Show
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Save as File Save As Macro that changes the file name also rosscortb Word VBA 5 05-19-2014 08:40 AM
Save as File error: You are attempting to save a file format that is blocked by file block setting zatlas1 Office 8 04-28-2012 02:37 PM
Add Note a File Save wwilli1070 PowerPoint 0 12-10-2010 08:21 AM
Save as File Word Macro: Save file as text with current file name jabberwocky12 Word VBA 2 10-22-2010 12:23 PM
How to save file on CD? DennisWG Word 0 09-07-2010 10:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:33 PM.


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