Consulting

Results 1 to 3 of 3

Thread: how to accept all changes in folders and subfolders

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    how to accept all changes in folders and subfolders

    I am trying to refresh my VBA Skills and our company has disabled many functions in Word 2016.

    The code below works, but I can't get it to do subfolders as well, any suggestions are much appriciated in advance. Additionally, if you know how to easily addin 'deleteallcomment' that would be incredible.
    Sub UpdateDocuments()
    Application.ScreenUpdating = False
    Dim strFolder As String, strFile As String, strDocNm As String, wdDoc As Document, Rng As Range
    strDocNm = ActiveDocument.FullName
    strFolder = GetFolder
    If strFolder = "" Then Exit Sub
    strFile = Dir(strFolder & "\*.doc", vbNormal)
    While strFile <> ""
      If strFolder & "" & strFile <> strDocNm Then
        Set wdDoc = Documents.Open(FileName:=strFolder & "" & strFile, AddToRecentFiles:=False, Visible:=False)
        With wdDoc
          For Each Rng In .StoryRanges
            Rng.Revisions.AcceptAll
          Next
          .Close SaveChanges:=True
        End With
      End If
      strFile = Dir()
    Wend
    Set wdDoc = Nothing
    Application.ScreenUpdating = True
    End Sub
    Last edited by macropod; 11-28-2018 at 08:25 PM. Reason: Added code tags & formatting

Tags for this Thread

Posting Permissions

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