I have the following macro I wrote back in 2001 which addresses locations set under Options:Advanced:File Locations. I would like to add the default save location for new templates but do not know where to find that setting using vba.
Code: Select all
Sub TemplatesPathIsMacro()
'
' TemplatesPathIsMacro Macro
' Macro written 3 December 2001 by Charles Kyle Kenyon
' modified 4 January 2024 to add documents location
'
Dim sUserTemplatesLocation As String
Dim sWorkgroupTemplatesLocation As String
Dim sStartUpTemplatesLocation As String
' Dim sNewTemplatesLocation As String
Dim sDocumentsDefaultLocation As String
Dim sActiveDocumentPath As String
'
sUserTemplatesLocation = Options.DefaultFilePath(wdUserTemplatesPath) & "\"
sWorkgroupTemplatesLocation = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & "\"
sStartUpTemplatesLocation = Options.DefaultFilePath(wdStartupPath) & "\"
' sNewTemplatesLocation = Options.DefaultFilePath ' nothing here to match
sDocumentsDefaultLocation = Options.DefaultFilePath(wdDocumentsPath) & "\"
If ActiveDocument.Path <> "" Then
sActiveDocumentPath = "The active document's save path is: " & ActiveDocument.Path & "\"
Else
sActiveDocumentPath = "This document has never been saved!"
End If
'
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 & vbCrLf & vbCrLf _
& "The default save location for documents is: " & sDocumentsDefaultLocation & vbCrLf _
& vbTab & "Note: this may have been temporarily changed by a save." & vbCrLf & vbCrLf _
& sActiveDocumentPath, _
Buttons:=vbInformation, title:="Default file location settings"
End Sub