Jump to content

Macro scripting help needed for Winword 2003


Dislocated Time

Recommended Posts

I'm pretty new to visual basic... I've done script / batch writing in AutoIt and MSDOS.

I've written a macro in Winword 2003 that works and I want it to be executed when someone does a SaveAs and then enters the filename.

The macro has to be executed exactly between the time that the person has entered the filename and the closing of the file.

I'll explain this in more detail:

The footer of the Winword file I am working on contains a table with fields linked to custom docProperties: Machine number, Filename and Version. In our template, these custom docProperties just have xxx placeholders in them.

We usually take the time to enter the machine number, version and file type in the docProperties before we close the file because certain fields in the document are linked to the docProperties.

The filename that we use to save the file itself already consists of the filetype, machine number and version.

I want to save some of our colleagues some time by generating the footer automatically.

I did manage to get all this done in a macro HOWEVER the macro works fine in my file when I execute it manually, but I want it to be executed when the user either changes the filename or saves it for the very first time, so that it really is generated automatically, every time someone changes the name of the file or saves a new file.

Can someone explain shortly or in depth, how to execute a macro during the saving of a file?

I'd really appreciate it.

Thanks.

Edited by Dislocated Time
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...