Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-15-2016, 09:30 PM
paulkaye paulkaye is offline Replacing a comment with underline or other formatting (or adding that formatting to commented text) Windows 7 64bit Replacing a comment with underline or other formatting (or adding that formatting to commented text) Office 2007
Advanced Beginner
Replacing a comment with underline or other formatting (or adding that formatting to commented text)
 
Join Date: Nov 2011
Posts: 84
paulkaye is on a distinguished road
Default 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):
  1. Empty all of the comments so that they're all blank. The client sees the blank comments highlighting the interesting text.
  2. Add real formatting (e.g., underline and/or bold) to the text on which the comments are placed. (Our comments are placed over all the words in the interesting text, just like one would use the highlighter tool.)
  3. Option 2, plus removing the comments entirely.
Does anyone know how to achieve any of the above options, or something else that might work?

Thanks in advance.


Replacing a comment with underline or other formatting (or adding that formatting to commented text)
Reply With Quote
  #2  
Old 05-16-2016, 01:04 AM
gmayor's Avatar
gmayor gmayor is offline Replacing a comment with underline or other formatting (or adding that formatting to commented text) Windows 10 Replacing a comment with underline or other formatting (or adding that formatting to commented text) Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,105
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 05-16-2016, 01:15 AM
paulkaye paulkaye is offline Replacing a comment with underline or other formatting (or adding that formatting to commented text) Windows 7 64bit Replacing a comment with underline or other formatting (or adding that formatting to commented text) Office 2007
Advanced Beginner
Replacing a comment with underline or other formatting (or adding that formatting to commented text)
 
Join Date: Nov 2011
Posts: 84
paulkaye is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 05-16-2016, 05:27 AM
gmayor's Avatar
gmayor gmayor is offline Replacing a comment with underline or other formatting (or adding that formatting to commented text) Windows 10 Replacing a comment with underline or other formatting (or adding that formatting to commented text) Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,105
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

.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
Reply With Quote
  #5  
Old 05-16-2016, 05:38 AM
paulkaye paulkaye is offline Replacing a comment with underline or other formatting (or adding that formatting to commented text) Windows 7 64bit Replacing a comment with underline or other formatting (or adding that formatting to commented text) Office 2007
Advanced Beginner
Replacing a comment with underline or other formatting (or adding that formatting to commented text)
 
Join Date: Nov 2011
Posts: 84
paulkaye is on a distinguished road
Default

Thank you - that works perfectly!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing a comment with underline or other formatting (or adding that formatting to commented text) The Logic Behind Apply Formatting of Surrounding Text in Reveal Formatting Pane Instructor Mark Word 4 04-06-2016 01:32 PM
Replacing a comment with underline or other formatting (or adding that formatting to commented text) My table of contents formatting is adding periods when I update it icor1031 Word 4 02-11-2016 02:18 PM
Replacing a comment with underline or other formatting (or adding that formatting to commented text) 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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:38 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft