Results 1 to 11 of 11
  1. #1
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Macro - globally remove tracked changes/changebars (MS Word 2003 (SP3))

    Hello,

    I am looking for a macro that will point to a folder full of MS Word .DOC files, go through every document and remove all tracked changes (e.g. red markup) and change bars and re-save the documents.
    The end result is that all of the tracked changes and change bars have been removed from the word documents.

    Thanks in advance for any suggestions.

    Regards,

    Jim

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro - globally remove tracked changes/changebars (MS Word 2003 (SP3)

    Do you want to accept all changes, or to reject all changes in the documents?

  3. #3
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro - globally remove tracked changes/changebars (MS Word 2003 (SP3)

    Hello Hans,

    I want to accept all changes. Thanks for your reply.

    Jim

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro - globally remove tracked changes/changebars (MS Word 2003 (SP3)

    With the code you already have to process a folder full of documents, use this:

    Sub ReplaceInDoc(doc As Document)
    doc.AcceptAllRevisions
    End Sub

  5. #5
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro - globally remove tracked changes/changebars (MS Word 2003 (SP3)

    Will that remove change bars as well?

    Thanks,

    Jim

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro - globally remove tracked changes/changebars (MS Word 2003 (SP3)

    Yes, if all changes are accepted (or rejected, for that matter), the change bars will disappear - the change bars mark the location of tracked changes in the document. If there are no tracked changes, there are no change bars.

  7. #7
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro - globally remove tracked changes/changebars (MS Word 2003 (SP3)

    Ok wonderful. Thanks again for your assistance with this macro Hans. As always, it is appreciated.

    Regards,

    Jim

  8. #8
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro - globally remove tracked changes/changebars (MS Word 2003 (SP3)

    Hello Hans,

    I ran the macro and it has worked great, except that I have one chapter where there are stil tracked changes, according to the popup.

    So, I went into that chapter manually and accepted all changes and saved.

    Next I re-ran the macro and it stopped once again on that chapter. Do you know why it has NOT accepted all tracked changes, when I had told it to do so? The document is not locked (or protected).

    Also, what must I do to remove comments (that are seen when viewing the documents - Final Showing Markup)? I assume comments are handled differently than tracked changes.

    Thanks,

    Jim

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro - globally remove tracked changes/changebars (MS Word 2003 (SP3)

    I don't know why you can't remove tracked changes from one of the documents either manually or using code if the document isn't protected.

    You could add the following code to ReplaceInDoc to remove comments:
    <code>
    Dim i As Integer
    For i = doc.Comments.Count To 1 Step -1
    doc.Comments(i).Delete
    Next i
    </code>
    It doesn't matter whether you insert this before or after existing code within ReplaceInDoc.

  10. #10
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro - globally remove tracked changes/changebars (MS Word 2003 (SP3)

    Hans,

    This addition to the macro works 100 percent. Thanks.
    I am still having a problem with a popup error on one chapter. But when I go to look in the chapter, I do not see any type of tracked changes. It must be a gremlin lurking inside the document.

    I can deal with that though.

    Thanks again,

    -J

  11. #11
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Macro - globally remove tracked changes/change

    If your macro does not already turn off change tracking, make sure to do that first, or you might have new dynamically generated changes appearing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •