Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

Reference issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fred Kruger - 13 Oct 2006 19:38 GMT
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.

I work for a company that has thousands of users of word in varying versions
we want to be able to amend the normal.dot with certain information and also
put some sub procedures into it and save without deleting and reinstalling.

ie to do this i would normally open the normal.dot and have to manually add
the items and refernce to the template and type the sub procedures into it
anfd then save it. Can I do this through code? or do I have to manually do it
to every one?

If it is possible please can you tell me how.

Fred
Jean-Guy Marcil - 13 Oct 2006 19:47 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.