aurian
07-18-2012, 03:40 PM
I am trying to write a macro to convert all text with the "UserComment" character style applied, into a MS Word inserted comment.
The macro does a Find, successfully converts the first block of text it encounters into a comment. Then it does create an empty comment for the second block of text it encounters, but it never copies the text into the comment. At this point, Word crashes.
I am running Word 2003 SP3.
Please help!!
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("UserComment")
While Selection.Find.Execute = True
With Selection.Find
Selection.Cut
Selection.Comments.Add Range:=Selection.Range
Selection.Paste
Selection.EscapeKey
End With
Wend
End Sub
here is the Word crash error from the event log:
Faulting application winword.exe, version 11.0.8169.0, stamp 465f2a40, faulting module winword.exe, version 11.0.8169.0, stamp 465f2a40, debug? 0, fault address 0x000b6988.
The macro does a Find, successfully converts the first block of text it encounters into a comment. Then it does create an empty comment for the second block of text it encounters, but it never copies the text into the comment. At this point, Word crashes.
I am running Word 2003 SP3.
Please help!!
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("UserComment")
While Selection.Find.Execute = True
With Selection.Find
Selection.Cut
Selection.Comments.Add Range:=Selection.Range
Selection.Paste
Selection.EscapeKey
End With
Wend
End Sub
here is the Word crash error from the event log:
Faulting application winword.exe, version 11.0.8169.0, stamp 465f2a40, faulting module winword.exe, version 11.0.8169.0, stamp 465f2a40, debug? 0, fault address 0x000b6988.