How do I get a Macro to run immediately after a save as?

G

Guest

I have created a Macro for a filename and path in the footer of my Word
template, but now, I would like to get it to run automatically after "save
as" is used, so that the filename and path regenerates to pick up the newest
file name and location.

Thanks,

Nic
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?bmlj?=,
I have created a Macro for a filename and path in the footer of my Word
template, but now, I would like to get it to run automatically after "save
as" is used, so that the filename and path regenerates to pick up the newest
file name and location.
Create a macro named FileSaveAs so that it will execute when the user picks
this command.

Display the dialog box in the macro; when the user dismisses it, call your code
to write the file name and path, as you do now. Something like this:

Sub FileSaveAs()
Dialogs(wdDialogFileSaveAs).Show
MySubNameHere
End Sub

Sub MySubNameHere()
'your code to write the filename
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top