Microsoft Word VBA to save as prompting user to enter file name & path

Claire Jackson

Board Regular
Joined
Jun 30, 2020
Messages
76
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have a word template document with a userform which populates several bookmarks. What I need is a simple code that upon populating the word document from the userform via the command button click it then asks for a new save location for the normal word document and then closes the template without saving.

I know it's a basic question but for the life of me I can't find the solution?

Please help?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
If you are actually using a Word template they way Word templates are supposed to be used, the user will have little choice but to save the new document without affecting the template.
 
Upvote 0
It can be as simple as:
VBA Code:
Application.Dialogs(wdDialogFileSaveAs).Show
You cannot close the parent template while to document remains open. Word does that automatically when you close the document.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top