Word macro to toggle tracked changes after running an “update fields”

5 pts.
Tags:
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)
ASKED: June 13, 2008  1:19 AM
UPDATED: June 14, 2008  6:01 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BrentSheets
    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.
    6,875 pointsBadges:
    report
  • BobBeechey
    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
    750 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following