Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompt user for File name when creating a new Word Doc

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I have a user who is starting a new docuamnt and in-advertantly does not save it.<br><br>So I created a Template and a macro that uses that template.<br>It create a new doc and lay-de-dah this works fine... But I would like it in addition to prompt the user to save it.<br>I started recording a macro but of course when I keyed in a name it stored that nameand then wants to save every document with that same name when you click the button. How can I using VBA bring up the menu and have it wait until th esuer enters a new name?<br>Or prompt the user somehow and then stuff that in VBA to save it.<br><br>TIA<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Try this in your macro:<br><br>With Dialogs(wdDialogFileSaveAs)<br>&nbsp;&nbsp;&nbsp;&nbsp;'Specify default name or leave it blank with &quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;.Name = &quot;DefaultDocumentName.doc&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;.Show<br>End With<br><br>Hope this helps!<br>
 
Thanks it works<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
I know this is an old thread, but I'm trying to apply the same code to an Excel (Save) macro and not having any luck. What am I doing wrong?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top