Originally Posted by
wadiohead
Out of curiousity, why is it better to keep normal minimal?
e.g.
1. The larger is the Normal template, the longer it takes Word to startup.
2. App specific stuff should be in its own template, instead of cluttering up Normal, or global, templates.
3. Normal template should be read-only to prevent attacks by viri.
4. If Normal template is read-only, you can just ignore unexpected changes to Normal template caused by badly written apps and macros.
Below are the only two modules in my Normal template in Word 2003, where WordVBNormal is a class in a registered DLL. All other code is in global templates, attached templates or other DLLs.
With this setup, I can run with Normal as read-pnly, except when I momentarily have to reset the reference to the DLL when I change the DLL.
Note that the ResetToolsOptionsView macro is in Normal ONLY because there is a timing issue when Word starts and the macro, as currently coded, will not run from a global template (I may try to eliminate this restriction some day).
Option Explicit
Public clsWordVBNormal As WordVBNormal
Public Sub AutoClose()
SetupClass
clsWordVBNormal.AutoClose
End Sub
Public Sub AutoExec()
SetupClass
clsWordVBNormal.AutoExec
End Sub
Public Sub AutoExit()
SetupClass
clsWordVBNormal.AutoExit
End Sub
Public Sub AutoNew()
SetupClass
clsWordVBNormal.AutoNew
End Sub
Public Sub AutoOpen()
SetupClass
clsWordVBNormal.AutoOpen
End Sub
Private Sub SetupClass()
Dim docTemp As Word.Document
If clsWordVBNormal Is Nothing Then
If Documents.Count = 0 Then
Set docTemp = Documents.Add(Visible:=vbFalse)
End If
Set clsWordVBNormal = New WordVBNormal
clsWordVBNormal.SetClass Word.Application
If Not (docTemp Is Nothing) Then
docTemp.Close
Set docTemp = Nothing
End If
End If
End Sub
Option Explicit
Public Sub ResetToolsOptionsView()
clsWordVBNormal.ResetToolsOptionsView
End Sub
Originally Posted by
clhare
Is it possible to put the other template (with the macros) in a folder other than the Startup folder?
If it is possible, how would I call the macros that reside in another file? This would be my preferred approach. People move around from team to team alot here, and if I didn't have to use the Startup folder as the location for the actual macros, it would be alot easier. Since each team would be given access to a specific folder when they join the team, I would just add their macros file somewhere in that folder. Then I can just update the folder in that one location and they'd automatically have access to the updated macros.
global templates can be anywhere, but then you have to make sure that you set them up to load as global.
those in the Startup directory load automatically.
if you want each time to have access to different sets of global templates, then the AutoExec maro could be used to load/unload the appropriate templates for each team
Also, you could have a separate Startup directory for each team and use Tools |Options | File Locations to identify the appropriate Startup directory for each team member.