Hi R,
Is it possible to get text that has been commented to show up as
highlighted text instead of just surrounded by colored brackets?
you can use a macro, such as the one below:
Option Explicit
Private Const highlightColor As Long = wdBrightGreen
'Alternate values: wdPink, wdYellow, wdTurquoise
' wdGreen, wdBlue, wdRed, wdTeal, wdDarkRed, wdDarkYellow
' wdDarkBlue, wdGray25, wdGray50, wdViolet, wdBlack
Sub InsertAnnotation()
Dim rng As Word.Range
Dim cmt As Word.Comment
'Optional: prompt to enter the comment text
'Comment out the following 7 lines of code
'if you do not want to be prompted
Dim commentText As String
Dim msgPrompt As String
Dim msgTitle As String
commentText = ""
'Change the text in "quotes" to change the prompt
msgPrompt = "Enter the comment text"
'Change the text in "quotes" to change
'the title at the top of the box
msgTitle = "Comment text"
commentText = InputBox(msgPrompt, msgTitle)
If commentText = "" Then Exit Sub
'Set the highlight
HighlightSelection
Set rng = Selection.Range
'Create the comment
Set cmt = ActiveDocument.Comments.Add(rng, commentText)
'Optional: Display the Reviewing task pane
'Comment out the following 6 code lines if
'you do not want to force display of the task pane
'If there's more than one task pane, check if the second one
'is in Web View; if not, set the Revisions task pane
If ActiveWindow.Panes.Count > 1 Then
If ActiveDocument.ActiveWindow.Panes(2).View <> wdWebView
Then _
ActiveWindow.View.SplitSpecial = wdPaneRevisions
Else
'if there's only one pane for the document
'display the Revisions task pane
ActiveWindow.View.SplitSpecial = wdPaneRevisions
End If
End Sub
Sub HighlightSelection()
'Check whether the selection is only a blinking insertion point
'If it is, extend the range to include the entire word
'the IP is in, or the one to which it is directly adjacent
If Selection.Type = wdSelectionIP Then
'Comment out the following line if you want to retain
'a bracket only, and not highlight an entire word
'if there is no selection
Selection.Words(1).Select
End If
Selection.Range.HighlightColorIndex = highlightColor
End Sub
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8
2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail
