Reading an (RTF)Rich Text Format or MS-WORD file in Vb.NET

G

Guest

Hello,
I want to read (RTF) files in my VB.NET programme. How can i do it. I apply
the same method of reading text files, but it does not save the formatting of
text like (bold, italics, underline) etc.

So , how can i make programme which allows me to read (RTF) Rich Text Format
files or Microsoft WORD files in VB.NET through FILE HANDLING.

Plz help me
 
R

rawCoder

Hi Eshban,

Dont know abt the Word Docuemnt .. but for the RTF is a plain text file with
the text in proper format.

In case you want to read the RTF as a file, u will have to Parse the RTF
text and then get the text as well as the formatting.
This can be tedious, the parsing. 'Cause you might have to know the rtf in
detail and these \f0 things can be hard to read.

One thing that you can do - if it fits ur scenario - is that you can take an
object of RichTextBox and set its RtfText property with the text you have
read from the file - some juggling for the header might be required here.
And then use the RTF controls other methods to do whatever you want to do
with the data.

Ask if there is something else.

HTH
rawCoder
 
J

Jonathan Allen

I don't think you can read Word files without making calls into MS-Word (COM
or VBA).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top