CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2002
    Posts
    5

    parse word .docs

    Hi, I am looking for a way to parse word docs into text files in the pocketpc environment, any ideas?

    Thanks,Kyle



  2. #2
    Join Date
    Jun 2001
    Location
    Ireland
    Posts
    56

    Re: parse word .docs

    This is how to output Word docs to a text file, not to sure about PocketPCs.


    Dim oWord as Word.Application
    Dim szWordDoc as string
    Dim szTextFile as string
    Dim i as Integer
    Dim icount as Long


    Sub main()
    '*** szWordDoc to be the Word Document you want parse
    '*** szTextFile to be the txt file

    set oWord = CreateObject("word.application")

    oWord.Documents.Open szWordDoc

    icount = 1

    Open szTextFile for Output as #3

    for icount = icount to oWord.ActiveDocument.Paragraphs.Count

    print #3, oWord.ActiveDocument.Paragraphs(icount).Range.Text

    next icount

    Close #3

    oWord.Quit wdDoNotSaveChanges

    set oWord = nothing





    Don't forget to rate!!!!

    Andy

    Andrew Lennon (Berlitz)
    Automation Dev Engineer

  3. #3
    Join Date
    Mar 2002
    Posts
    5

    Re: parse word .docs

    Wow, that is the simplest code i have seen yet to do this sort of thing. The only problem is that the Word object model is not exposed in Windows CE. Thanks a lot for your help though. Any other ideas???


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

Featured