PDA

View Full Version : Referencing a custom function in global template



Gurberly
09-30-2011, 06:18 AM
Hi

Referencing a custom function in global template which is added at users word start up

We have a global template located on a file server which loads when Word loads. A shortcut in the users word\startup points to the global template initiating/loading when Word starts

This global template includes a number of routines and functions that I would like to access from other templates, e.g. set up database connections rather than having to incorporate the same code for a database connection in every template

In the new template , I add a reference to the global template by pointing it at the global template on the file server. However when the reference is added the document path in the “add references” dialogue box shows as c:\Documents and Settings\MyUserName\Local Settings\

In the VBA project properties on the left hand side under references it shows as Reference to ~WRC0000.dot. It does not show the name of the template, e.g. like it does for the normal.dot template

I can access the functions in the global template quite happily if I load the new template e.g.

If cbs_library.connectICMS() Then
MsgBox "Connected"
End If

cbs_library.KillDBConnection cnicms
End Sub



… but other users just get a compile error, cannot find project or library (unless they repoint the reference to the global template on the file server.

Is there a way to force the reference to the global template e.g. S:\templates\GlobalWord.dot rather than referencing this ~WRC0000.dot. file?

Note version is Word 2000 (v10)
Also we operate in a Citrix environment i.e. dumb terminals on users desks, applications like Word are installed on a Citrix server farm

Any thoughts or suggestions welcome!!

G