Fred Kruger was telling us:
Fred Kruger nous racontait que :
> I know this may sound strange but can anyone tell me if it is posible
> to refernce the normal.dot at runtime to a global template.
[quoted text clipped - 10 lines]
>
> If it is possible please can you tell me how.
I would not recommend this set up.
It is by far much easier to just deploy a global template.
If you must.. this code, for example, will open the Normal.dot file:
Documents.Open NormalTemplate.FullName
This means you can assign a document object to the normal.dot template if
you have too...
But why can't you use a global template instead?

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Fred Kruger - 13 Oct 2006 22:20 GMT
Jean-Guy
Thanks for this I am aware of the global template against Normal.dot,
however the company I work for requires that all new documents created on
their machines ahve to have restriction markings dependent on the
classification of the content of the document. Therefore ideally it would be
best to set the normal.dot with all the necessary details etc and subsequent
coding in the document open and document new in the document object of the
normal.dot.
This could be done by a complete over write of all normal.dots on all
machine however this would create problems with personal macros of people who
have stored them in the normal.dot.
Hence the request to know if it is possible using vb code to open the
normal.dot set a refernce to globally mounted template men and then insert
code into the sub routines of the document object Private Sub Document_New()
and Private Sub Document_open().
If this is posible then it would save the issue of trying to educate users
on saving their macros to a template and setting it as a add in.... If this
makes sense.
The code you gave opened the normal template but is it pos to reference and
setup the sub procedures without physically typing it in?
Thanks in anticipation.
Fred
> Fred Kruger was telling us:
> Fred Kruger nous racontait que :
[quoted text clipped - 26 lines]
>
> But why can't you use a global template instead?
Jean-Guy Marcil - 14 Oct 2006 04:48 GMT
Fred Kruger was telling us:
Fred Kruger nous racontait que :
> Jean-Guy
>
[quoted text clipped - 22 lines]
> reference and setup the sub procedures without physically typing it
> in?
Keep in mind that users playing around with their Normal.dot might interfere
with the code you plan to inject into it. Also, if Normal.dot crashes.. your
code will be gone. Finally, any document created based on ate template other
that Normal.dot will not be intercepted by your Document_New() and
Document_Open() subs.
This is why it is better to have a global add-in with document events that
can get fired whenever a document is created/opened.
See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnword2k2/html/
odc_wdappevnt.asp
It was written for Word 2002, but still applies to Word 2003 (It is just
that Word 2003 has a few more events, especially those targeted fro handling
XML).
But if you still insist on going the Normal.dot road, combine the code I
gave you before to get a handle on the Normal.dot template, then see the
online help on the following for examples of what to do next:
ActiveDocument.VBProject.VBComponents

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org