Consulting

Results 1 to 3 of 3

Thread: Looking for VBA to show tracked changes and hide comments in Word Document

  1. #1
    VBAX Newbie
    Joined
    Feb 2024
    Posts
    1
    Location

    Looking for VBA to show tracked changes and hide comments in Word Document

    For many years we have had two VBA macros (called from buttons in a ribbon extension). One macro sets up the open document to show Tracked changes *and* comments, the other sets up the document to show only tracked changes but hides comments

    The important lines of the macros are
    ActiveWindow.View.ShowRevisionsAndComments = True;
      ActiveWindow.View.ShowComments = False/True
    With recent changes of the commenting features in Office/word, both macros show comments, and I cannot hide comments while seeing tracked changes with my VBA

    My analysis show that the behaviour is linked to the new "show comments" button in the comments group in the Review tab.
    This "Show Comments" button has two variants: "Contextual" or "List". when "show comments - Contextual" has been selected from the ribbon my original procedures work, but only until I close the document

    it also seems that just using the "show comments" button once to turn off display of comments make our original procedures work.

    I can not find a VBA method to do the "Show Comments - Contextual" function (and I am not sure what function is behind the button "Show comments - off"

  2. #2
    VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,442
    Location
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    If you want to show only tracked changes and hide comments, you can use the following VBA code:
    Sub ShowTrackedChangesOnly()
        With ActiveWindow.View
            .ShowRevisionsAndComments = True
            .RevisionsView = wdRevisionsViewFinal
            .ShowComments = False
        End With
    End Sub
    Last edited by georgiboy; 04-01-2024 at 04:40 AM. Reason: Edited format of VBA
    Ezekiel Moen

Posting Permissions

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