Results 1 to 7 of 7

Thread: Accessing data from word documents

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    7

    Accessing data from word documents

    At present, in order to get data out of a word document i have to open it with word, as in Documents.Open. Having to do this with a number of documents is quite slow. Are there more efficient ways of accessing data from within a document?

    I am quite impressed with the performance of ADO with MS Access databases. Not having to open Access to run queries makes life a breeze. I know it's not the same thing but reading data from 200+ documents takes a long time

    Thanks!

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

    Re: Accessing data from word documents

    As of yet I have not come across anything like this yet. Een when you do a right click > print, it still opens Word briefly. The fileformat may be the only way to read it without instanciating an instance of Word so I would say to search for something using this logic.
    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
    New Member
    Join Date
    Jul 2005
    Posts
    7

    Re: Accessing data from word documents

    Thanks a heap for your speedy reply,

    I don't think i have 1/100000th the skills to reverse engineer the doc format , and that IS what you're referring to no? Or have i mis-interpreted?

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

    Re: Accessing data from word documents

    Sort of, if you open the file using standard File I/O then you may be able to identify where the data starts.
    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
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Accessing data from word documents

    You can open the doc using the WOM and save it as a dos textfile. Then you can use the File I/O to open the textfile and read it. Although, this does use the WOM it may be just as slow but if the docs dont change and you need to get data again, you could read from the textfiles as a shortcut.
    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

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    7

    Re: Accessing data from word documents

    Yeah the documents won't be modified, will this enable me to retain formatting though? I need to retain tables and dot points, otherwise i would store all the clauses as text files

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    7

    Re: Accessing data from word documents

    YAY! I just found a much quicker way of doing things.

    Selection.InsertFile fileName:=clauseDoc

    Thanks for your help! I learnt quite a bit

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