Re: Getting Range of a Comment?
- From: "Klaus Linke" <info@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 26 May 2006 06:31:54 +0200
Hi Baher,
Line feeds are Chr(11), returns Chr(13) or vbCr.
You'll probably want to replace them with spaces:
Dim st as String
st=cmt.Scope.Text
st=Replace(st,Chr(11)," ")
st=Replace(st,vbCr," ")
Maybe replace any vbTab in cmt.Scope.Text with a space too, if there's the
possibility of tabs there?
st=Replace(st,vbTab," ")
and then clean up double spaces
st=Replace(st," "," ")
s = s & "IP#[" & cmt.Author & cmt.Index & "]" & _
" " & cmt.Range.Text & vbTab & "Text: " & st & vbCr
Greetings,
Klaus
"Baher" <Baher@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb:
klaus,
would you know how i could take out any linefeeds or returns in the
cmt.Scope.Text?
here is my code now...
Sub DisplayComments()
Dim s As String
Dim cmt As Word.Comment
Dim doc As Word.Document
For Each cmt In ActiveDocument.Comments
s = s & "IP#[" & cmt.Author & cmt.Index & "]" & " " &
cmt.Range.Text
& vbTab & "Text: " & cmt.Scope.Text & vbCr
Next
Set doc = Documents.Add
doc.Range.Text = s
End Sub
"Klaus Linke" wrote:
"Klaus Linke" <info@xxxxxxxxxxxxxxxxxxxx> schrieb:
You can't copy/paste all comments in one go from the reviewing pane,
but
you could from the (old) comments pane:
ActiveDocument.ActiveWindow.View.SplitSpecial=wdPaneComments
BTW, if you copy/paste from that pane, you will likely loose the comment
markers.
But if you take the content into a string variable,
myString=Selection.Text,
the string should contain a Chr(5) for each comment marker.
Klaus
.
- Follow-Ups:
- Re: Getting Range of a Comment?
- From: Baher
- Re: Getting Range of a Comment?
- References:
- Re: Getting Range of a Comment?
- From: Klaus Linke
- Re: Getting Range of a Comment?
- From: Baher
- Re: Getting Range of a Comment?
- From: Klaus Linke
- Re: Getting Range of a Comment?
- From: Klaus Linke
- Re: Getting Range of a Comment?
- Prev by Date: Re: Marking location of section breaks for later use [Word 2003]
- Next by Date: Re: list box
- Previous by thread: Re: Getting Range of a Comment?
- Next by thread: Re: Getting Range of a Comment?
- Index(es):
Relevant Pages
|