View Single Post
 
Old 03-21-2024, 06:37 AM
fd110 fd110 is offline Windows 10 Office 2021
Novice
 
Join Date: Nov 2023
Posts: 7
fd110 is on a distinguished road
Default comment macro

Dim sTemp As String
With Selection.Find
.ClearFormatting
.Text = "\C*\C"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
End With

Do While Selection.Find.Execute
sTemp = Selection.Text
sTemp = Mid(sTemp, 2, Len(sTemp) - 2)
sTemp = Trim(sTemp)
Selection.Text = ""
Selection.MoveEnd Unit:=wdCharacter
Selection.MoveStart Unit:=wdCharacter, Count:=-1
If Selection.Text = " " Then Selection.Text = " "
Selection.Collapse
ActiveDocument.Comments.Add Range:=Selection.Range, Text:=sTemp

Loop
Reply With Quote