Field FILENAME update

N

Neil

I need the FILENAME field to update automatically when a document is
opened (not just when the document is printed)

Microsoft declare that they have stopped this happening to improve the
speed of opening a document. I have also experimented with Autotext
fields with no luck.

MS also tell me that the workaround is to write a VBA module (something
like activedocument.fields(1).update) which updates the field. This I
understand.

Overall, I have written a procedure (called UpdateDoc) to help an
operator update over a 1000 docs. This procedure embeds the FILENAME
field and it would now seem that I also need to add a Document_Open()
procedure to the ThisDocument module. Again I have no problem with
this.

BUT

How do I append the Document_Open() procedure AS A PART OF THE OVERALL
UpdateDoc PROCEDURE?

Thanks for your interest

Neil
 
J

Jezebel

Rather than appending Document_Open to the ThisDocument module of every
document, call it AutoOpen and add it just once to the template attached to
those documents.

Or create an add-in with a WithEvents reference to the Word application, and
put the code in the DocumentOpen event.


Trying to write code to manipulate other code is tricky (to say the least!);
and in most cases is explicitly blocked by the security settings (as it
should be). But if you must: have a look at the VBE object. That gives you
access to the code modules. And you *really* don't want to end up with 1000
documents each containing macro code!
 

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