Skip to content

Instantly share code, notes, and snippets.

@pa-0
Forked from masanobuimai/macro1.vba
Created May 22, 2025 01:04
Show Gist options
  • Save pa-0/843bb5821d7038df5b64b5065ffd84b1 to your computer and use it in GitHub Desktop.
Save pa-0/843bb5821d7038df5b64b5065ffd84b1 to your computer and use it in GitHub Desktop.
Accept All Non-Deletion Changes
Sub Macro1()
' 挿入/変更/削除以外の変更履歴を一括承諾する
' https://docs.microsoft.com/ja-jp/office/vba/api/word.wdrevisiontype
For Each myRev In ActiveDocument.Revisions
myType = myRev.Type
Select Case myType
Case _
wdRevisionDisplayField, _
wdRevisionParagraphNumber, _
wdRevisionParagraphProperty, _
wdRevisionProperty, _
wdRevisionSectionProperty, _
wdRevisionStyle, _
wdRevisionStyleDefinition, _
wdRevisionTableProperty
myRev.Accept
End Select
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment