Events in Word XP

W

Walter Hofmann

If I have an open document with DocumentBeforePrint and
DocumentBeforeSave events, these events are also executed in documents
which have no macros and shouldn't execute them. How can I prevent this?

Thank you for helping.
Walter
 
H

Helmut Weber

Hi Walter,
maybe this can help.
But seems to be pretty complicated.
http://www.google.de/groups?hl=de&lr=&ie=UTF-8&oe=UTF-
8&threadm=8l8ulj%24urb%241%
40nnrp1.deja.com&rnum=17&prev=/groups%3Fq%3Dcount%2Bmacros%
2Bgroup:microsoft.public*%26hl%3Dde%26lr%3D%26ie%3DUTF-8%
26oe%3DUTF-8%26as_drrb%3Db%26as_mind%3D12%26as_minm%3D5%
26as_miny%3D2000%26as_maxd%3D11%26as_maxm%3D9%26as_maxy%
3D2003%26start%3D10%26sa%3DN
I'd rather look for a simpler method for
distinguishing between groups of documents,
like Name, Location, Author, Topic or whatsoever.
Greetings from Bavaria, Germany
Helmut Weber
"red.sys" & chr$(64) & "t-online.de"
Word 97, NT 4.0
 
W

Walter Hofmann

Hi Helmut

It did :)

Just had to insert the following line and the extensibility library:

If ActiveDocument.VBProject.VBComponents.Count < 2 Then Exit Sub

Thanks,
Walter
 
C

Cindy Meister -WordMVP-

Hi Walter,
If I have an open document with DocumentBeforePrint and
DocumentBeforeSave events, these events are also executed in documents
which have no macros and shouldn't execute them. How can I prevent this?
Personally, I like to use the DocumentChange event (activated in a
separate class) to check the AttachedTemplate property of the newly
activated window's document. If it's not the one that contains the other
events, "turn them off". If it's the right one, then turn them back on.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

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