Read Formated Text From MS Word

  • Thread starter Thread starter sb Luis
  • Start date Start date
S

sb Luis

I Use the following code to read from MS Word, but I couldent read Formated
Text (RTF).
How Can I read formated text from MS Word Doc without using clipboard.
thanks.

Word.ApplicationClass WordApp = new Word.ApplicationClass();
.....
// Let's get the content from the document
Word.Paragraphs DocPar = Doc.Paragraphs;
// Count number of paragraphs in the file
long parCount = DocPar.Count;
// step through the paragraphs
while (i < parCount)
{
i++;
t1 = ImputDocPar.Range.Text;
}
 
sb_Luis,

What happens when you do this? Do you get an exception? It's hard to
say what the issue is without knowing what is wrong.
 
Hi
There is no error with this code, but the result is a plain text, not a
formated text. I want RTF of each paragraph in MS Word.
Luis.

Nicholas Paldino said:
sb_Luis,

What happens when you do this? Do you get an exception? It's hard to
say what the issue is without knowing what is wrong.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

sb Luis said:
I Use the following code to read from MS Word, but I couldent read
Formated Text (RTF).
How Can I read formated text from MS Word Doc without using clipboard.
thanks.

Word.ApplicationClass WordApp = new Word.ApplicationClass();
.....
// Let's get the content from the document
Word.Paragraphs DocPar = Doc.Paragraphs;
// Count number of paragraphs in the file
long parCount = DocPar.Count;
// step through the paragraphs
while (i < parCount)
{
i++;
t1 = ImputDocPar.Range.Text;
}

 
Luis,

Your code doesn't show anything that is specific to processing RTF or
HTML code. Can you post the code you are using to load and save the
document?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

sb Luis said:
Hi
There is no error with this code, but the result is a plain text, not a
formated text. I want RTF of each paragraph in MS Word.
Luis.

Nicholas Paldino said:
sb_Luis,

What happens when you do this? Do you get an exception? It's hard to
say what the issue is without knowing what is wrong.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

sb Luis said:
I Use the following code to read from MS Word, but I couldent read
Formated Text (RTF).
How Can I read formated text from MS Word Doc without using clipboard.
thanks.

Word.ApplicationClass WordApp = new Word.ApplicationClass();
.....
// Let's get the content from the document
Word.Paragraphs DocPar = Doc.Paragraphs;
// Count number of paragraphs in the file
long parCount = DocPar.Count;
// step through the paragraphs
while (i < parCount)
{
i++;
t1 = ImputDocPar.Range.Text;
}


 

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

Back
Top