Re: Track Changes VBA Granular information needed



We're back to the point where I need to know what you plan to do with the
results before I can suggest specific code. What follows is more general, in the
hope that you can learn to develop the specifics for yourself.

The InStr function takes at least two strings (there could be more arguments,
but let's start simple). If the second string occurs somewhere in the first
string, then the function returns the position of the first matching character
from the start of the first string; otherwise it returns zero. For example,
InStr("abcd", "bc") returns the value 2, while Instr("abcd", "cb") returns 0
because "cb" doesn't occur in "abcd".

Another bit you need to know is that the comparison in InStr is case-sensitive;
that is, "Bc" would not be found in "abcd" because the case of the "B" is
different. When you want to do a comparison that ignores case, convert both
strings to lower case with the LCase() function.

One other thing is that any one .FormatDescription string can contain two,
three, or more separate formatting items. For example, one could be "Font: 12pt,
Bold, Italic". If you're keeping separate track of bold formatting and italic
formatting, you need to test the .FormatDescription string separately for each
item.

So here's a small example; you would replace the MsgBox statements with whatever
it is you want to do with the information about formatting:

Dim oRev As Revision
For Each oRev In ActiveDocument.Revisions
If oRev.Type = wdRevisionProperty Then
If InStr(LCase(oRev.FormatDescription), "bold") > 0 Then
MsgBox "bold included"
End If
If InStr(LCase(oRev.FormatDescription), "italic") > 0 Then
MsgBox "italic included"
End If
If InStr(LCase(oRev.FormatDescription), "font color") > 0 Then
MsgBox "font color included"
End If
End If
Next

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.

On Wed, 18 Jun 2008 11:22:01 -0700, Krumrei <Krumrei@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:

Jay,

Lets say I do want to use the InStr function to extract specific titles in
the revisions properties, such as Italic, bold, etc. etc how to I put that in
my code listed?

Thanks!


"Krumrei" wrote:

I have a VBA code that allows me to extract and create a new document and
formatted report of the track changes that happened to the document.

However, I need it to be more specific in what changes.

Sorry for the clarification issue.


1. I need to know what fields ( wdrevisionproperty etc etc. ) I can use to
extract more specific changes.

2. I have a macro built that pulls all document changes, but they only
include Insert and Deletes and Table Cell property changes, and then extracts
them into a new document.

3. I need to dig deeper such as knowing if the change in the document was a
Bold, Italic, Underline or Font or style change, I have 13 different changes
within the document that I want to have on a report, to identify what changes
happened on the document.

Again, I really need to know which VBA wd code I need to use to extract a
more granular piece of what changed, not the high level, insert and delete in
my Macro.

The review pane of the track changes document, outlines more granular
changes in the document, such as Format Font Bold changes, but again, I am
not sure which wd code I need to use to extract that into a report with my
Macro.




Thanks!
.



Relevant Pages

  • Re: 2 different formats of text in a single cell?
    ... Enter the text "Some bold and red words" in A1 and then give this code a try... ... Dim Word As String ... Select the desired formatting, and that will be applied to the def. ...
    (microsoft.public.excel.misc)
  • Re: How To Search Files of All Extensions
    ... SMITH) in a rich text document and then bold only two of the letters in the ... file or files for a string or perhaps someone's name. ... formatting in between the string such as bold, underline, etc. ... a free version of their $30 Pro product. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Find&Replace formatted (bold + underline) text
    ... The following macro will apply bold formatting to the words inside \b \b0, ... there are bold and underlined words in these ... these formatted words in the source and when translating the string insert ... these keywords in the correct new order. ...
    (microsoft.public.word.vba.general)
  • Re: Extract Digit Function Question
    ... Function ExtractDigits(cell As String) As Variant ... 'extract 1st continuous set of digits ... > and formatted your cell not to show decimal places. ... > by the formatting of the cell. ...
    (microsoft.public.excel.programming)
  • RTF-to-ASCII Conversion
    ... If a RTF field is converted to ASCII text (in order to be stored in an Oracle database), is formatting also saved in this string (i.e. bold, italic, bullets, indent, etc.)? ...
    (microsoft.public.vb.general.discussion)

Loading