CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Word To Text

  1. #1
    Join Date
    Feb 2001
    Location
    Israel
    Posts
    94

    Word To Text

    I want to Make a wordfile into a .txt file.
    Meaning save only its data without all the fontsize and stuff like that.
    I have an option in word Saveas .txt file. How do I do that from VB?

    FatMan


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Word To Text

    I am listening


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Feb 2001
    Location
    Israel
    Posts
    94

    Re: Word To Text

    you are listening ?
    what for?
    I am not speaking....

    FatMan


  4. #4
    Join Date
    Jan 2000
    Location
    Saskatchewan, Canada
    Posts
    595

    Re: Word To Text

    I think the easiest way would be to use the rich text box. The richtextbox has a loadfile property which you can load in the word document and it has a savefile method , which you can save as a text file.

    rtb1.loadfile "myword.doc", rtfRTF
    rtb1.savefile "mynewdoc,txt", rftText

    You could set the visible property to false if you want it displayed on your form.

    David Paulson

  5. #5
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: Word To Text

    d.paulson's idea is workable but I think you will loose some information as RichTextBox is not that compatible with WORD format. You might wanna venture into using WORD ACTIVEX component which will allow you to open MS WORD itself and instruct it to open the specific file. Then you can perform TEXT file conversion by using MS WORD. Of course the catch is to have MS WORD installed on the PC running this program.

    Just my two cents,
    -Cool Bizs

    Good Luck,
    -Cool Bizs

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