Word Week – Auto Backup Macro

Propellerhead Top Tip
Share

Propellerhead’s Word Week draws to a close with one of the best ever Word tips. It’s a Macro, a simple little program that runs within Word and It has saved me countless hours of worry and frustration over the years. The idea is that with a simple keyboard shortcut it will make an instant backup copy of the document you are working on, saving it to a floppy disc, USB flash drive, another partition on your hard discs or as in my case, a UDF formatted CD-R. This macro should work in all versions of Word from W2000 onwards (if anyone wants a version for W97 please drop me a line on the BootLog website).

The Macro is set to save the copy to drive D: but you can switch this to the drive/location of your choice by changing the drive letter or path in line 4, for example, to back up to a floppy line 4 would read ‘ChangeFileOpenDirectory "A:". 

So let’s begin. Go to Tools > Macro > Macros and click Create, give it a name. Click the Create button again and the Visual Basic window opens with a flashing cursor after the line ‘Macro created….’ Now copy and paste the following block of text from ‘Sub RickSave()’  to ‘StatusBar…’ into the box at the cursor insertion point and close the window.

Sub Ricksave()

Dim Pathroute

Pathroute = ActiveDocument.FullName

ChangeFileOpenDirectory "D:"

ActiveDocument.SaveAs FileName:=ActiveDocument.Name, FileFormat:= _

wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:=True, _

WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _

SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _

False

ChangeFileOpenDirectory "C:"

ActiveDocument.SaveAs FileName:=Pathroute, FileFormat:= _

wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:=True, _

WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _

SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _

False

StatusBar = ActiveDocument.Name & " saved in active directory and on backup drive"

Now all you have to do is assign the macro a memorable keyboard shortcut. Right click on an empty area of the toolbar and select Customise then the Keyboard button. In the Categories windows scroll down to Macros then in the Macros list click on Ricksave. Click into the ‘Press new shortcut’ box and enter the two keys you want to use (I use Ctrl + S). It will tell you if this combination is already in use and ask you to confirm that you want to change it. When you are happy click Assign. Exit the dialogue boxes and give it a try. For even more great Tips, for Word, Windows and all of your favourite applications head over to the BootLog website at www.rickmaybury.com

(Display Name not set)
For latest tech stories go to TechDigest.tv