Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Krumrei Krumrei is offline
external usenet poster
 
Posts: 8
Default Adding Formatting to Insert and Delete Export for Track Changes

I got this piece of a MACRO that will allow me to extract the Inserted and
Deleted items in a new document.

However, I need it to also extract other revisions such as format, style and
grammer to the code.

Here is what I have for the Insert and Deleted Track changes in word.


The Case wdRevisionInsert, wdRevisionDelete is already there, but when I add
something like wdRevisionsmarking it does not pull the formatted changes on
the Track Changes report within the document.









'Get info from each tracked change (insertion/deletion) from oDoc and insert
in table
For Each oRevision In oDoc.Revisions
Select Case oRevision.Type
'Only include insertions and deletions
Case wdRevisionInsert, wdRevisionDelete

'In case of footnote/endnote references (appear as Chr(2)),
'insert "[footnote reference]"/"[endnote reference]"
With oRevision
'Get the changed text
strText = .Range.Text

Set oRange = .Range
Do While InStr(1, oRange.Text, Chr(2)) 0
'Find each Chr(2) in strText and replace by
appropriate text
i = InStr(1, strText, Chr(2))

If oRange.Footnotes.Count = 1 Then
strText = Replace(Expression:=strText, _
Find:=Chr(2), Replace:="[footnote
reference]", _
Start:=1, Count:=1)
'To keep track of replace, adjust oRange to
start after i
oRange.Start = oRange.Start + i

ElseIf oRange.Endnotes.Count = 1 Then
strText = Replace(Expression:=strText, _
Find:=Chr(2), Replace:="[endnote
reference]", _
Start:=1, Count:=1)
'To keep track of replace, adjust oRange to
start after i
oRange.Start = oRange.Start + i
End If
Loop
End With
'Add 1 to counter
n = n + 1
'Add row to table
Set oRow = oTable.Rows.Add

'Insert data in cells in oRow
With oRow
'Page number
.Cells(1).Range.Text = _
oRevision.Range.Information(wdActiveEndPageNumber)

'Line number - start of revision
.Cells(2).Range.Text = _

oRevision.Range.Information(wdFirstCharacterLineNu mber)

'Type of revision
If oRevision.Type = wdRevisionInsert Then
.Cells(3).Range.Text = "Inserted"
'Apply automatic color (black on white)
oRow.Range.Font.Color = wdColorAutomatic
Else
.Cells(3).Range.Text = "Deleted"
'Apply red color
oRow.Range.Font.Color = wdColorRed
End If
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Comments in Track Changes Dr. DD Microsoft Word Help 0 August 30th 07 07:22 PM
track word changes ON while track formatting changes is OFF driller Microsoft Word Help 2 March 17th 07 01:51 PM
adding a date to a section of document to track additions sandy Microsoft Word Help 3 February 17th 07 02:34 AM
Word 2003 - Track Changes/Adding Comment windsong Microsoft Word Help 1 October 28th 05 12:10 PM
Way to export to Quark 5 and save formatting? Adding rows to tables Microsoft Word Help 0 September 28th 05 04:47 AM


All times are GMT +1. The time now is 02:07 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"