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