|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Replacing a comment with underline or other formatting (or adding that formatting to commented text)
Hi,
My team often uses "comments" as a way of highlighting interesting text in documents. Sometimes these "comments" actually have comments in them, but normally they're just blank. We have found several advantages to working this way. However, when we send such a document to a client, we'd prefer that there be no real comments in it. We'd be happy with any of the following options (which we could do in a duplicate document, or simply undo subsequently):
Thanks in advance. Replacing a comment with underline or other formatting (or adding that formatting to commented text) |
#2
|
||||
|
||||
Easy enough with a macro e.g.
Code:
Sub ReplaceComments() Dim oComment As Comment For Each oComment In ActiveDocument.Comments oComment.Scope.Font.Underline = wdUnderlineSingle oComment.Scope.Font.Bold = True 'oComment.Range.Delete 'set the comment to no value oComment.DeleteRecursively 'optional Next oComment lbl_Exit: Set oComment = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Hi Graham,
Thank you for your reply. Unfortunately I got the message: "Compile error: Method or data member not found" When I click ok, I'm taken to the macro code page (is that the debugger?), with ".DeleteRecursively" highlighted. Any ideas? Thanks, Paul |
#4
|
||||
|
||||
.DeleteRecursively is not part of the Word 2007 command set. Use .Delete instead,
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
|||
|
|||
Thank you - that works perfectly!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The Logic Behind Apply Formatting of Surrounding Text in Reveal Formatting Pane | Instructor Mark | Word | 4 | 04-06-2016 01:32 PM |
My table of contents formatting is adding periods when I update it | icor1031 | Word | 4 | 02-11-2016 02:18 PM |
How to do a find and replace on formatting for partial word formatting. | BrianSvanvik | Word | 2 | 09-04-2015 01:20 PM |
Formatting contents after Tab of continuous lines or formatting specific area of word | pawii | Word | 1 | 05-12-2014 05:24 AM |
Replacing text string within document, it's not retaining formatting | livemusic | Word | 4 | 02-25-2013 12:33 AM |