What syntax places the cursor in the comment?

C

Charlie Mac

I am adding comments using:

Selection.Comments.Add Range:=Selection.Range, Text:= "testing"

What syntax places the cursor in the comment?

Thanks.
 
D

Doug Robbins - Word MVP

Dim newcomment As Comment
Set newcomment = Selection.Comments.Add(Range:=Selection.Range)
newcomment.Range.Select


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

Charlie Mac

Doug,

I appreciate your response, but that opens and selects the comments
pane. I want to leave that pane closed.

I am trying to add comments with values from a two dimensional array.
Only if the value of Mytag is a 1 do I want to add a blank comment
with the cursor in the comment ready for the user to enter text.

Thanks.

Charlie

Selection.Comments.Add Range:=Selection.Range, Text:=Aray(MyTag, 2)
 
D

Doug Robbins - Word MVP

Neither your original question, nor your response to my response makes it
really clear what you are doing, but maybe:

Dim newcomment As Comment
Set newcomment = Selection.Comments.Add(Range:=Selection.Range)
newcomment.Range.Text = [Something from your array if mytag (whatever and
whereever that is) is not 1]


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
K

Klaus Linke

Hi Charlie,

I'm not clear what you want to do either...
myComment.Scope is the range of the commented text, if you need that.

Regards,
Klaus
 
C

Charlie Mac

Klause,

Thank you for your response. After setting View, Print Layout, I can
block a section of a document and click a button to insert a blank
comment on the document using:

Selection.Comments.Add Range:=Selection.Range, Text:="")

What I am after is to have the cursor placed in the Baloon - ready for
my typing. It is probably easy...but not for me. Thanks.

Take care,

Charlie in Texas
 
K

Klaus Linke

Hi Charlie,

Yuk, that doesn't seem as easy as it should be.
Word seems to switch views, and also brings up the comment pane when I
didn't expect it.

Something like this seems to work:

Dim myComment As Comment
Dim curViewType As Long
curViewType = ActiveDocument.ActiveWindow.View.Type
Set myComment = Selection.Comments.Add( _
Range:=Selection.Range)
' close comments pane
ActiveWindow.ActivePane.Close
' return to original view (page layout?)
ActiveDocument.ActiveWindow.View.Type = curViewType
myComment.Edit

Regards,
Klaus in Stuttgart
 
C

Charlie Mac

Klaus in Stuttgart,

I ran into the same problem. If I use:

Selection.Comments.Add Range:=Selection.Range, Text:="Testing "

it will not open the extra pane, which is great, but I cannot figure
out how to set mycomment and use mycomment.edit. I want to avoid the
flash of the extra pane opening and closing. Must be some way....

Thanks.

Charlie in Texas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top