Forum Discussion
Templates in Word Startup Folder are not loading
Here are some of the macros I used to discover or install in the Word StartUp folder. At least one of them is more than 20 years old.
Sub StartUpOpenStartupPath()
' Opens Windows Explorer window for Startup Folder
' Charles Kyle Kenyon 2018-02-14
'
Shell "explorer " & Application.StartupPath
End Sub
Sub ShowWorkGroupFolder()
'
' ShowWorkGroupFolder Macro
' Macro written 11/04/2000 by Charles K. Kenyon
' Displays currently set WorkGroup Folder location for application
'
' If this is being run with the file containing the code as the Active Document,
' it will further instruct the user that the
' startup folder is the location to hold this file.
' Otherwise, it just gives the information.
'
On Error GoTo ErrorHandler
'
Selection.Collapse ' to keep from deleting macrobutton by a keypress after running macro
'
'
'
MsgBox Prompt:="Your WorkGroup Templates Folder location is " & _
Options.DefaultFilePath(wdWorkgroupTemplatesPath), Buttons:=vbOKOnly, _
title:="Current WorkGroup Templates Folder Setting Information"
'
On Error GoTo -1
Exit Sub
'
ErrorHandler: ' No Workgroup Templates Folder Loctation set
MsgBox Prompt:="The location of the WorkGroup Templates Folder has not been set on this Computer." _
& Chr(13) & Chr(10) & Chr(13) & Chr(10) & _
"You can set a folder location now.", _
title:="No WorkGroup Templates Folder Location Set", _
Buttons:=vbInformation
Dialogs(wdDialogToolsOptionsFileLocations).Show
On Error GoTo -1
End Sub
' ==========================================================================
Sub StartupShowStartUpPath()
' Macro written by Charles Kenyon 2014-02-25
' Shows setting for Startup Folder location in Microsoft Word in a message box.
'
MsgBox _
Prompt:="Your StartUp folder location is " & Application.StartupPath & _
"." & Chr(13) & Chr(10) & Chr(13) & Chr(10) & ".", _
Buttons:=vbOKOnly, _
title:="Current Startup Folder Setting Information"
' See also StartupOpenStartupPath
' Shell "explorer " & Application.StartupPath
'
End Sub
Sub TemplatesPathIsMacro()
'
' TemplatesPathIsMacro Macro
' Macro written 3 December 2001 by Charles Kyle Kenyon
'
Dim sUserTemplatesLocation As String
Dim sWorkgroupTemplatesLocation As String
Dim sStartUpTemplatesLocation As String
'
sUserTemplatesLocation = Options.DefaultFilePath(wdUserTemplatesPath) & "\"
sWorkgroupTemplatesLocation = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & "\"
sStartUpTemplatesLocation = Options.DefaultFilePath(wdStartupPath) & "\"
'
MsgBox Prompt:="The user templates are in:" & vbCrLf _
& sUserTemplatesLocation & vbCrLf & vbCrLf _
& "The Workgroup Templates are in:" & vbCrLf _
& sWorkgroupTemplatesLocation & vbCrLf & vbCrLf _
& "The Startup (Add-In) Templates are in:" & vbCrLf _
& sStartUpTemplatesLocation, _
title:="Templates location settings"
End Sub
Sub InstallAddIn()
' Saves the template containing code in user's startup folder
' User must allow running of macro
' written by Charles Kenyon December 5, 2016
' https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-msoffice_custom/how-to-install-a-word-template-add-in-for-all/f41f816c-1c71-47ae-a570-519eff6bde07
'
Dim strStartup As String
strStartup = Application.StartupPath
ThisDocument.SaveAs2 (strStartup & "\" & ThisDocument.Name)
End Sub