Results 1 to 8 of 8

Thread: Capture the deleted word in a word document using VB

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    29

    Capture the deleted word in a word document using VB

    Dear all

    How i can write to log file with line Position, Date and altered text when i have done some alterations on an existing document.
    can anyone tell me about this.
    on which event of document i should use.

    Regards
    nagarjuna

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Capture the deleted word in a word document using VB

    Tools > Options > Track Changes tab > aand make any modifications to the settings you want. Then ...
    VB Code:
    1. ActiveDocument.TrackRevisions = True
    Is about as close as you can get.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    29

    Question Re: Capture the deleted word in a word document using VB

    ok. i want to display what are the chnages done on the document. i would like to capture the TIME, DELETED or INSERTED CONTENT. and the POSITION of the change.



    Thank you

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Capture the deleted word in a word document using VB

    Then whatever options you have set for those markups, you would do a .ind on the document for each of those items by markup and/or color/font styles, etc. you will need to have show revisions enabled so they show up in the document.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    29

    Re: Capture the deleted word in a word document using VB

    I have set the track Changes,
    i dont want to highligt the changes done on the document.
    i dont want to dispaly the deleted text, i want to hide it.
    How can i do it from vb code.
    i used the ActiveWindow.view.ShowHighlight = True
    Even i am able to View.

    Regards
    Nagarjuna

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Capture the deleted word in a word document using VB

    Ok, then this should get you started in iterating through the Revisions collection. You can do what ever you want with the items. Write to file, set to a variable, etc.
    VB Code:
    1. Application.Documents(1).Revisions.Item(1).Range.Text
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    29

    Re: Capture the deleted word in a word document using VB

    Dear
    Thanks for ur Sugessions
    I got the solution.

    To hide track changes we used
    ActiveDocument.ShowRevisions = False

    and to accept the all Document Revisions
    ActiveDocument.Revisions.AcceptAll

    Thank u

    nagarjuna

  8. #8
    Member
    Join Date
    Apr 2003
    Posts
    54

    Re: Capture the deleted word in a word document using VB

    but i am not able get the revisions in the tables. I am using MS word 2000 and vb6.
    How can i get the track changes in the tables also?
    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