PDA

View Full Version : Solved: Is selected text a (deleted) revision mark?



marcelma
10-04-2010, 01:21 PM
Hello,

is there any way for a macro to find out whether the selected text is deleted or inserted text of a revision mark? If yes, is there a way as well, to find out who revised the text when? All this information is available visually, but I have no clue how to extract it with a VBA program.

Thanks a lot in advance,
Marcel

fumei
10-04-2010, 02:06 PM
If the text is deleted, you can not select it, now can you? At least not in the document itself. Deleted is deleted.

So I do not know what you mean by selected text. If your Selection includes the revision mark, then you can programmatically get the text of what is in the revision, but NOT if it was inserted versus deleted.
Dim myTC As Revision

For Each myTC In Selection.Range.Revisions
MsgBox myTC.Range.Text
Next

marcelma
10-04-2010, 02:17 PM
Thank you very much. :-)

However, I do not need the text of a revision mark within my selection, I have selected a single character and want to know whether this is a deleted character or an inserted character or just normal text.

greetings,
Marcel

marcelma
10-04-2010, 02:23 PM
One addition (since I only now read your first sentence). Sure I can select deleted text when the "show revision marks" option is on. The text appears visually as being crossed out, while inserted text appears as being underlined.
greetings,
Marcel

fumei
10-05-2010, 10:09 AM
MsgBox Selection.Range.Revisions(1).Type
A number is returned. Look up the various values returned in the Object Browser.

For example:

wdRevisionDelete = 2

marcelma
10-05-2010, 03:38 PM
Thanks a lot. :-) his was exactly the information I needed. Don't know why I didn't find it till now.

For those who are interested in the other values:
wdNoRevision = 0
wdRevisionDelete = 2
wdRevisionInsert = 1
wdRevisionParagraphProperty = 10
wdRevisionReconcile = 6
wdRevisionSectionProperty = 12
wdRevisionStyleDefinition = 13
wdRevisionConflict = 7
wdRevisionDisplayField = 5
wdRevisionParagraphNumber = 4
wdRevisionProperty = 3
wdRevisionReplace = 9
wdRevisionStyle = 8
wdRevisionTableProperty = 11

marcelma
10-22-2010, 11:40 AM
Hi mkp,

I am not quite sure what you are talking about. I have been asking about revision marks within a text document. Here "deleted" is a property of the text which can be elicited, if one knows the "magic words". - Anyway, for me my question has been answered by fumei. :-)

greeting,
Marcel