Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sequence of reviewing comments numbers in Word

Status
Not open for further replies.

stephen2005

Programmer
Feb 13, 2005
53
IE
Reviewing comments numbers in Word not automatically incrementing in sequence.

eg.

Comment One #1
Comment Two #2
Comment Three #3
Comment Four #4

If I delete 'Comment Two', I should get:

Comment One #1
Comment Three #2
Comment Four #3

Instead, I get:


Comment One #1
Comment Three #3
Comment Four #4

The comment numbers are now out of sequence*
 
Don't ask why I have to do this pointless excercise. Some PHB upstairs wants to know if it can be done.
 
As he explains himself here....

Hi, as discussed, my question is: is there a way to make comments appear numbered in sequence?
The problem noted is a that a new comment inserted between two existing comments has suddenly stopped other existing comments from being renumbered, which has up until now been the result of inserting comments. My main concern is whether this is normal or does this signal the possibility of another deeper problem.

blah, blah, blah
 
The numbers you are putting in the comments are TEXT. Comments are not "numbered".

They ARE however, indexed.

So (with some assumptions):

Comment One #1 = Index(1), Text = "One #1"
Comment Two #2 = Index(2), Text = "Two #2"
Comment Three #3 = Index(3), Text = "Three #3"
Comment Four #4 = Index(4), Text = "Four #4"

If I delete 'Comment Two', you WILL get:

Comment One #1 = Index(1), Text = "One #1"
Comment Three #3 = Index(2), Text = "Three #3"
Comment Four #4 = Index(3), Text = "Four #4"

The point being is that yes, the INDEX will adjust, but any text in the comment absolutely will not. They are NOT numbered.

If you put the first comment into a document and put "Comment 1,567,892", it would still be Comment.Index(1).


Gerry
My paintings and sculpture
 
You have these 4 comments in order initially.
If you directly delete the comment, it automatically updates the comment numbers.
If you delete the text representing the comment, then word marks that text/comment for deletion without actually deleting it. When you say' Accept Changes' then word deletes that text and comment thus updating the comment numbers.

Sharing the best from my side...

--Prashant--
 
pgorule - could you clarify this?
If you directly delete the comment, it automatically updates the comment numbers.

If I put four comments into a document, like this:

#1
#2
#3
#4

Directly deleting the second comment, will absolutely not update the numbers in the comment. They are text. The index number will be updated, because they are part of a collection.

So I am not sure what you are saying. What numbers are updated?

Further, the index number comes from a direct indexing of the order the comments appear in the document.

Comment text "#1" Index = 1
Comment text "#2" Index = 2
Comment text "#3" Index = 3
Comment text "#4" Index = 4

If the second comment is deleted, then:

Comment text "#1" Index = 1
Comment text "#3" Index = 2
Comment text "#4" Index = 3

If a comment is inserted between comment 1, and current comment 2 (text = "#3"), it will become index(2).

Comment text "#1" Index = 1
Comment text "New #2" Index = 2
Comment text "#3" Index = 3
Comment text "#4" Index = 4

The "number" of the comment is the order it appears in the document. It has no relation to content (text) of the comment. Unless there is something I don't know - which is entirely possible, and I would love to know how to do it.

Gerry
My paintings and sculpture
 
Hi, just to clarify, it's not the text in the comments that I'm refering to (which is just text and has no mention of numbers), it's the index. the problem is the index is not updating when I delete a commnet
 
This is not true. The index is always updated. The index is simply the count of the number of comments.

If there are three comments, then the index is 1, 2, 3.

If there are four comments, then the index is 1, 2, 3, 4.. Take out one comment...the index is 1, 2, 3.

How do know the index is not updating? What data is giving you this information?
Code:
Sub ShowIndex()
Dim oComment As Word.Comment
    For Each oComment In ActiveDocument.Comments
        MsgBox oComment.Index & "  " & oComment.Range.Text
    Next
End Sub
You may think that your problem is the index is not updating when you delete a comment, but I quite confident that this will always show the correct index for each comment.

Gerry
My paintings and sculpture
 
Again, comments are not numbered. They are indexed by the order they appear in the document. That index is refreshed by ANY action to the Comment Collection - either by adding, or deleting. As far as I know, even changing the text of a comment will refresh the index.

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top