|
-
Mar 4th, 2006, 01:39 AM
#1
Thread Starter
Member
word document revisions
Hai,
I am using VB6.0 and MS word 2000. When I modify the content of the document, I can able to get the altered text(deleted, inserted) from the revisions collection. At the same time, when I modify the text in the tables I am not able to get the altered text. Its giving an error. The error message is 'Requesting object is not availble'. How can I get the altered text in the table?
Thanks in advance.
-
Mar 4th, 2006, 01:28 PM
#2
Junior Member
Re: word document revisions
Can you post the code so we can see where you are getting the error
-
Mar 6th, 2006, 12:15 AM
#3
Thread Starter
Member
Re: word document revisions
Private Sub cmdLog_Click()
Set WApp = New Word.Application
Set WDoc = WApp.Documents.Open(App.Path & "\test.doc")
' Trace The Track Changes
WDoc.TrackRevisions = True
' Hide the Track Changes in the Document
WDoc.ShowRevisions = False
WApp.Visible = True
End Sub
Private Sub WApp_DocumentBeforeClose(ByVal Doc As Word.Document, Cancel As Boolean)
Call GetTrackChanges(Doc)
Doc.ShowRevisions = False
WDoc.TrackRevisions = False
Doc.ActiveWindow.View.ShowHighlight = False
' To Clear the Revisions by accepting changes
Doc.Revisions.AcceptAll
WDoc.Save
WDoc.Close
WApp.Quit
Set WDoc = Nothing
Set WApp = Nothing
End Sub
Public Sub GetTrackChanges(ByRef WDocPrint As Document)
Dim intCnt As Integer
WDocPrint.ShowRevisions = True
For intCnt = 1 To WDocPrint.Revisions.Count
MsgBox "Start Position : " & WDocPrint.Revisions(intCnt).Range.Start
MsgBox "Text : " & WDocPrint.Revisions(intCnt).Range.Text
Next intCnt
WDocPrint.ShowRevisions = False
End Sub
Its working fine if we alter the content. But the problem arises if we alter the table content. Its giving the error while executing the
MsgBox "Start Position : " & WDocPrint.Revisions(intCnt).Range.Start
statement.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|