Poll

Aboot this blog

This blog is a cross between a scrapbook and a diary. I hope you find something here of interest. If you’d like to keep up with things as I see them then you can subscribe to my news feed by clicking the icon below:

feed-icon-28x28.png

DISCLAIMER

Please note that any reviews/recommendations are based solely on my own experience and does not constitute a guarantee that you will have the same experience. Please do your own research before parting with any money - the risk is all yours!

The Briticiser

Looking for my world famous US to GB English spelling converter?

THE “BRITICIZSER”

www.us2uk.eu

IT’S HERE

Tags

  News     Odds and Sods     Acrobat     Reviews     Overcoming Disabilities     Browsers     Software     Equipment     3D Stuff     VBA     PHP     Utilities     Family     Word     Bits and Bobs         Tutorials     Windows     Hardware     Plausible Lies     Education     Bookmarks     Excel     Flatpress  

Find me on Facebook

facebook-icon-28x28.pngVisit my Briticiser Facebook Page to keep up with things here - lots of reviews of stuff I’ve really used and also all kinds of helpful computer tips with a heavy bias towards SAVING YOU TIME.

How to avoid losing changes made to a Word document opened from an email

Permalink: http://paul.us2uk.eu/?x=entry:entry141204-110640

When you open an Word document from an email and start making changes to it, it’s easy to forget that you’re only editing a “temporary” document. If you save your changes it’s often quite difficult to find your revised document again.

To help avoid that here’s a nice snippet of VBA code which you can use to issue you a warning message every time you open a document from an email, like this:

image

As a kind of “bonus” the following script will also warn you if the document you are opening has tracked changes enabled, and ask if you want to turn them off.

 

To install the code open up Word and press Alt+F11 to get into the Microsoft Visual Basic Editor.

In the left hand pane under “Normal” double click “Microsoft Word Objects” then double click “ThisDocument”, and enter the following code in the pane on the right. It should all look something like this:

image

And here’s the code to put in there. Please note that you’ll need to remove the apostrophe from the beginning of the line saying ‘MsgBox(ActiveDocument.Path) and then open an document from an email in order to find out and jot down the Windows file path of your temporary folder, which you need to enter later in the code. I figure if you’ve been brave enough to go this far then this step should be plain sailing for you :)

Private Sub Document_Open()

' the following code will determine if the document you are opening
' has tracked changes enabled and ask if you want to turn them off
' it will also warn you if you are opening a document from an email
' in case you intend making changes to it

Dim TurnOffTrackedChanges As Variant

' Uncomment the following line and open a Doc from an email to find out what your temporary folder is
'MsgBox(ActiveDocument.Path)

If ActiveDocument.TrackRevisions = True Then

TurnOffTrackedChanges = MsgBox("This document has tracked changes enabled." & vbCrLf & vbCrLf & "Do you want to turn tracked changes off?", vbYesNo, "WARNING - Tracked changes enabled!")

If TurnOffTrackedChanges = vbYes Then

ActiveDocument.TrackRevisions = False
MsgBox ("Tracked changes have been disabled :)")

End If

End If

' You need to put your temporary folder name below - uncomment the message box at the top to find out what it is

'example for WinXP
If ActiveDocument.Path = "D:Documents and SettingsPaulLocal SettingsApplication DataOperaOpera 11.64temporary_downloads" Then

' Example for Win7
'If ActiveDocument.Path = "C:UsersLee CliffordAppDataLocalOperaOperatemporary_downloads" Then

MsgBox ("WARNING! You may have opened a temporary copy of this document from an email as the current file path is" & vbCrLf & vbCrLf & ActiveDocument.Path & vbCrLf & vbCrLf & "If you intend making any changes you should save it RIGHT NOW to a different location... or you could lose your changes!"), vbCritical

End If

End Sub

Goodius luckius!

Support our caregiving

If you found anything on this site of use, interesting, or even mildly amusing then please consider dropping a few pennies in the jar to help us to take care of our disabled son who contracted encephalitis in 2007 at the age of 6 and who is now confined to a wheelchair. He is getting bigger as his mother and I get older, imagine that, please. Every penny we collect goes towards his upkeep, and towards his future care requirements.

Thank you.

Support our caregiving

Support our caregiving

If you found anything on this site of use, interesting, or even mildly amusing then please consider dropping a few pennies in the jar to help us to take care of our disabled son who contracted encephalitis in 2007 at the age of 6 and who is now confined to a wheelchair. He is getting bigger as his mother and I get older, imagine that, please. Every penny we collect goes towards his upkeep, and towards his future care requirements.

Thank you.