364,033 Members | 4770 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

Read Formated Text From MS Word

sb Luis
P: n/a
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[i].Range.Text;
}


Jan 6 '06 #1
Share this Question
Share on Google+
3 Replies


Nicholas Paldino [.NET/C# MVP]
P: n/a
Nicholas Paldino [.NET/C# MVP]
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]
- mvp@spam.guard.caspershouse.com

"sb Luis" <sb_luise@yahoo.com> wrote in message
news:%23vUG9ErEGHA.2380@TK2MSFTNGP12.phx.gbl...[color=blue]
>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[i].Range.Text;
> }
>[/color]


Jan 6 '06 #2

sb Luis
P: n/a
sb Luis
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 [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
message news:ur2h0MtEGHA.3004@TK2MSFTNGP15.phx.gbl...[color=blue]
> 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]
> - mvp@spam.guard.caspershouse.com
>
> "sb Luis" <sb_luise@yahoo.com> wrote in message
> news:%23vUG9ErEGHA.2380@TK2MSFTNGP12.phx.gbl...[color=green]
>>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[i].Range.Text;
>> }
>>[/color]
>
>[/color]


Jan 6 '06 #3

Nicholas Paldino [.NET/C# MVP]
P: n/a
Nicholas Paldino [.NET/C# MVP]
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]
- mvp@spam.guard.caspershouse.com

"sb Luis" <sb_luise@yahoo.com> wrote in message
news:eQcNNlxEGHA.1676@TK2MSFTNGP09.phx.gbl...[color=blue]
> 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 [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote
> in message news:ur2h0MtEGHA.3004@TK2MSFTNGP15.phx.gbl...[color=green]
>> 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]
>> - mvp@spam.guard.caspershouse.com
>>
>> "sb Luis" <sb_luise@yahoo.com> wrote in message
>> news:%23vUG9ErEGHA.2380@TK2MSFTNGP12.phx.gbl...[color=darkred]
>>>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[i].Range.Text;
>>> }
>>>[/color]
>>
>>[/color]
>
>[/color]


Jan 7 '06 #4

Post your reply

Help answer this question



Didn't find the answer to your C# / C Sharp question?

You can also browse similar questions: C# / C Sharp