Question

  Asked: Jun 13 2008   1:19 AM GMT
  Asked by: Calberts


Word macro to toggle tracked changes after running an "update fields"


Macros, track changes

I have a macro that will turn off track changes (if they are on or leave them off if they are off) and then update the field codes in the document. Now I need to know how to return the document to its original state after it runs the update portion of the macro (track changes back on if they were on initially or leave them off if they were off initially)

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



Generally with the properties of an object if you use the object property in an assignment of a variable it returns teh current state. I would say to use the same object where you turn change tracking off to plug into a temporary variable the value when you start.

Then the last thing you should do (or one of them) is to set the tracking "object" to the value of the variable.

I'm not familiar with programatically turning change tracking on and off in Word but it would look something like this:

Dim TrackingState

TrackingState = objWord.document.trackchanges
...
objWord.document.trackchanges = False 'this is the command you already have to turn the tracking off
...
objWord.document.trackchanges. TrackingState
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development.

Looking for relevant Development Whitepapers? Visit the SearchWinDevelopment.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

BrentSheets  |   Jun 13 2008  12:30PM GMT

Calberts, it hampers getting an answer when you don’t provide enough information. You should always include what product or software your question is about. Thanks.

 

BobBeechey  |   Jun 14 2008  6:01AM GMT

The answer is on the right lines.
For Office 2007, we might have the following:
TrackingState = objWord.document.TrackRevisions
and to toggle state
objWord.document.TrackRevisions = Not objWord.document.TrackRevisions
and to restore state
objWord.document.TrackRevisions = TrackingState