ADD Balance - trademark of Charles Kenyon, Attorney at Law and Webmaster. Frequently Asked Questions - Help
Microsoft Word - Frequently Asked Questions - click to go to the question list.

on ADD Balance by Madison Wisconsin Criminal Defense Lawyer Charles Kenyon

Many people visit this site and use the information it contains. It costs money to keep on line and effort to update.
If you have received assistance here
please consider making a donation if you can.

 
Thank you. Charles Kenyon

Thank you for the suggestions. ("Smilies" from Woody's Lounge.) Click to go to Lounge. with input and suggestions from many on Thank you for the suggestions. ("Smilies" from Woody's Lounge.) Click to go to Lounge.
the Microsoft Newsgroups and at Woody's Lounge 

Click here to skip past FAQ questions list and other info and go directly to the start of this topic.

Search the FAQ site on Google.

Remember to Refresh your page. [F5].

 

 

Backing Up the Normal Template with a Macro

This page last revised: 06 Jan 2024 23:47:34 -0500 .

 

 

Chances are that if you are here you have already lost at least one normal template with all of its customizations. This gives you a macro that makes it easier to make backups.

The macro, as written:

  1. Puts the backups in a separate folder from the normal template. That folder will be named "Normal Backups" and will be located in the same folder as your user templates folder. By default, this folder is located in:
    C:\Users\ user name \AppData\Roaming\Microsoft\Templates
    but this can be different, depending on your operating system and on your own user settings. See:
    How to Find the Normal Template

    If your computer uses the default, the backups folder will be:
    C:\Users\ user name \AppData\Roaming\Microsoft\Normal Backups
  2. Creates the backups folder if it does not already exist
  3. When run, saves the normal template directly. This line can be eliminated if you want. It increases how long it takes the macro to run.
  4. Creates a new backup of the normal template with a date and time stamp in the name. This will not appear in the Recent Files lists.

 

Here is the macro:

Windows Version - tested

Sub NormalBackup()
' Run to Backup Normal template to dated backup
' Charles Kenyon 10 Jan 2020
' http://www.addbalance.com/word/normal-backup.htm
' Appends date to "Normal Backup" when saving, saves in special folder,
'   then returns save path to current - thanks to Jay Freedman for that
'
On Error Resume Next
Dim strName As String
Dim intLenPath As Integer ' length of path to templates folder without name of folder
Dim strPath As String 'Holder for current path
Dim strStorePath As String
'
Let intLenPath = InStrRev(Application.Options.DefaultFilePath(wdUserTemplatesPath), "\")
Let strStorePath = Left(Application.Options.DefaultFilePath(wdUserTemplatesPath), intLenPath)
Let strStorePath = strStorePath & "Normal Backups"
'
' Check if folder exists, if not, create it
If Dir(strStorePath) = vbNullString Then MkDir (strStorePath)
'
Let strPath = Application.Options.DefaultFilePath(wdDocumentsPath)
Let strName = "Normal Backup"
' add date & Time
Let strName = strName & " " & Format((Year(Now() + 1) Mod 100), "20##") & "-" & _
   Format((Month(Now() + 1) Mod 100), "0#") & "-" & _
   Format((Day(Now()) Mod 100), "0#") & "-" & _
   Format(Now(), "HH_mm") 'add date & time
'
' Do the save
' MsgBox strStorePath & strName & ".dotm"
ThisDocument.Save 'save normal template (code holder) itself
ThisDocument.SaveAs2 FileName:=strStorePath & "\" & strName & ".dotm", Addtorecentfiles:=False
' Reset save path
Let Application.Options.DefaultFilePath(wdDocumentsPath) = strPath
'
' reset error message
On Error GoTo -1
End Sub

Version for Mac - not tested

Sub NormalBackup()
' Run to Backup Normal template to dated backup
' Charles Kenyon 10 Jan 2020
' http://www.addbalance.com/word/normal-backup.htm
' Appends date to "Normal Backup" when saving, saves in special folder,
'  then returns save path to current - thanks to Jay Freedman for that
'
On Error Resume Next
Dim strName As String
Dim intLenPath As Integer ' length of path to templates folder without name of folder
Dim strPath As String 'Holder for current path
Dim strStorePath As String
'
Let intLenPath = InStrRev(Application.Options.DefaultFilePath(wdUserTemplatesPath), ":")
Let strStorePath = Left(Application.Options.DefaultFilePath(wdUserTemplatesPath), intLenPath)
Let strStorePath = strStorePath & "Normal Backups"
'
' Check if folder exists, if not, create it
If Dir(strStorePath) = vbNullString Then MkDir (strStorePath)
'
Let strPath = Application.Options.DefaultFilePath(wdDocumentsPath)
Let strName = "Normal Backup"
' add date & Time
Let strName = strName & " " & Format((Year(Now() + 1) Mod 100), "20##") & "-" & _
   Format((Month(Now() + 1) Mod 100), "0#") & "-" & _
   Format((Day(Now()) Mod 100), "0#") & "-" & _
   Format(Now(), "HH_mm") 'add date & time
'
' Do the save
' MsgBox strStorePath & strName & ".dotm"
ThisDocument.Save 'save normal template (code holder) itself
ThisDocument.SaveAs2 FileName:=strStorePath & ":" & strName & ".dotm", Addtorecentfiles:=False
' Reset save path
Let Application.Options.DefaultFilePath(wdDocumentsPath) = strPath
' reset error message
On Error GoTo -1
End Sub

If you use the Mac version, please write to me and let me know if it works for you. It should, but I do not have a Mac available to test it.

What to do with the macro:

See:

bullet Instructions for Installing Macros from Forums or Websites by Graham Mayor, MVP
bullet Install/Employ VBA Procedures (Macros) by Greg Maxey, MVP

You are going to want to place this in your normal template. It can be in a separate module.

The name of the Macro is "NormalBackup."

If you display the list of macros from within Word, you can find it there in alphabetical order. Alt+F8 will display a list of macros. (It may be Fn+Alt+F8. On the Mac it is Opt instead of Alt.)

See also:

bulletNormal Template in Microsoft Word - How to Open or Find the Normal Template
bulletSave Changes to the Global Template? Keeps Popping Up

A version of this page appears at: Backup Normal.dotm template using a macro (Microsoft Answers)

 

Return to Questions List

 

 The up-to-date version of this FAQ may be found at:

http://www.addbalance.com/word/

Download this FAQ in Word 97 format

Send e-mail

Changes / suggestions / ideas can be sent to Charles Kenyon.

Hit Counter views since 11 January 2020

Many people visit this site and use the information it contains.
It costs money to keep on line and effort to update.
If you have received assistance here
please consider making a donation if you can.

 
Thank you. ckk

Copyright 2000-2024 Charles Kyle Kenyon

FAQ provided as an adjunct / hobby as a part of my web site as a criminal defense lawyer.

Smile! Bumper stickers and jokes.

Click to return to table of contents page of Intermediate User's Guide to Microsoft Word.Click to go to Microsoft Word new users frequently asked questions site in a new browser window.
(Intermediate Users' Guide) - - - - - - - - - - - - - - - - - - -  (Questions List)