How to do If-then-else in Word vba

ntruong

Active Member
Joined
Aug 4, 2003
Messages
261
Hello Experts,

Its Friday afternoon again and I still have a heap of work in front of me but if some one(s) could land a helping hand here then I dont have to sleep in my workplace tonite ;)

Please how do I set the following if-then-else in Word macro:
If the file name is equal to "master version"
Do this blah blah (I can handle this part - I will run some macro function here)
otherwise
do nothing

Also, how do I tag a macro to an autoshape (tries after tries I still fail).

Many thanks for a quick help.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,225,322
Messages
6,184,275
Members
453,225
Latest member
adelphiaUK

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