PDA

View Full Version : inconsistent Word Events



Taff
03-02-2006, 08:25 AM
Hi,

I've been looking at a problem with Word and Application events. There
is code to run when the DocumentOpen event fires, but in certain
situations the even does not fire. This tends to be when a document is
opened and no existing word session is available. However when a word
session is already open, the event fires ok.

Is known behaviour or is it more likely to be environmental? Is there
anything I should try?

Thanks

Jacob Hilderbrand
03-02-2006, 08:39 AM
It should trigger all the time. Could macros have been disabled? When you are prompted to enable macros when the file opens, could they have been disabled occationally?

Taff
03-02-2006, 08:42 AM
I dont think so, the security is set to low. There isn't any prompt.

It seems to be the way that Word is opened that makes a difference.

fumei
03-03-2006, 04:45 PM
This tends to be when a document is
opened and no existing word session is available.Could you please clarify that? If there is no word session available....how COULD the document be opened? Are you trying to say that you have opened a Word doc - with no "Word session" available????

And what do you mean exactly "not available"?

Taff
03-06-2006, 02:15 AM
Apologies, I'll try and clarify.

By no word session available, I mean that winword.exe is not running, so that when you open the document by double clicking in the file system, the document is opened in a new word session.

This is when the events do not fire

TonyJollans
03-06-2006, 05:01 AM
I just checked and it fires correctly for me.

Can you describe what you are doing to set up your Application Event handler?

fumei
03-06-2006, 10:56 PM
I can pretty much guarantee that there is likely multiple Document_Open events somewhere. If there is code in the Document_Open event of normal.dot, AND code in the Document_Open event of a template, AND different code in the Document_Open event of a document cloned from that template.

Normal.dot Document_Open does NOT fire.
Template Document_Open fires first, document Document_Open fires second.

In any case, opening a Word document from the file system does indeed fire Document_Open procedures. So I would have to reiterate Tony's question regarding your Application Event handler.