Results 1 to 3 of 3

Thread: word document revisions

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2003
    Posts
    54

    Question 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.
    Suresh

  2. #2
    Junior Member
    Join Date
    Feb 2006
    Posts
    20

    Re: word document revisions

    Can you post the code so we can see where you are getting the error

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2003
    Posts
    54

    Question 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.
    Suresh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width