Word VBA Question - Using Custom Dialogs

DetroitDavid

Board Regular
Joined
Jul 20, 2013
Messages
211
I have a template in word, saved as Hort.dotm

Whenever I launch this a File > New > My Templates > Hort dotm, I’d like to open a custom dialog (which I can see how to do in many places on the web).

I need to find a good beginners tutorial on creating elements into this new dialog, storing the input, conditionally using the value to insert text (pre-formatted blocks?) in specific places in the document, then launching the File > SaveAs dialog with a filename derived from two of the variables and the date.

E.g. one variable example would be strLastName; so the new file would

  1. Open (document1.docx)
  2. Launch dialog
  3. Collect information
  4. Store these values as variables in code
  5. Fill-in the document with variable text at specific bookmarks
  6. Launch SaveAs with the default set to a specific path, and a suggested filename like:
    • strLastName & “ – “ & Address & strAddress2 & “MI”
    • DetroitDavid – 3033 Harrison Ave Trenton MI

Can anyone point me to a good tutorial on this?

TIA - DD
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,225,685
Messages
6,186,427
Members
453,354
Latest member
Ubermensch22

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