I am using WORD 97.

I have a global template in the startup folder, and I want some code to run
when any other document runs that imports a text file from the C:\test.txt
(which consists of a routine

Private Sub Document_Open()

..... do something

End Sub

into the ThisDocument of the ActiveDocument (not the global thisdocument)

Canit be done, and if so would someone be kind enough to tell me how?


--
Mark

Re: Import module to activedocument by Cindy

Cindy
Tue Apr 11 03:26:05 CDT 2006

Hi =?Utf-8?B?TWFyaw==?=,

Best you could probably do would be to intercept an event like DocumentChange.
Keep a list (array) of opened documents and, when the event is fired, check
whether ActiveDocument is one of these. If not, a new document was created or
an existing opened.

Note, though, that Word97 supports only a very limited number of events. I'm
not sure whether DocumentChange is one of them.

> I am using WORD 97.
>
> I have a global template in the startup folder, and I want some code to run
> when any other document runs that imports a text file from the C:\test.txt
> (which consists of a routine
>
> Private Sub Document_Open()
>
> ...... do something
>
> End Sub
>
> into the ThisDocument of the ActiveDocument (not the global thisdocument)
>
> Canit be done, and if so would someone be kind enough to tell me how?
>

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 :-)