How to take text from RichTextBox in VB6 to Word object?

R

Ritesh

Hi! There,

I have an application which has RichTextbox in it. Now, I need to produce
word document which has text with the same format as the RichTextBox.

Suppose, user has typed a letter with formatting like Bold, Underline, color
etc. Now, I would like to create a word document which should have the same
text and formatting.

When I take TextRTF to a string variable and write it into word document it
doesn't work. It shows all the formatting characters too.....

This can be done using Clipboard. But, I would like to avoid clipboard if
possible.

Any suggestion(s) or answer(s)

Thanks in advance,
Ritesh.
 
J

Jean-Guy Marcil

Ritesh was telling us:
Ritesh nous racontait que :
Hi! There,

I have an application which has RichTextbox in it. Now, I need to
produce word document which has text with the same format as the
RichTextBox.

Suppose, user has typed a letter with formatting like Bold,
Underline, color etc. Now, I would like to create a word document
which should have the same text and formatting.

When I take TextRTF to a string variable and write it into word
document it doesn't work. It shows all the formatting characters
too.....

This can be done using Clipboard. But, I would like to avoid
clipboard if possible.

Any suggestion(s) or answer(s)

Doesn't the RichTextBox control have a method that allows you to save its
content to an rtf file?

If so, use that to create the Word document (Once you have the rtf file, you
can open it and save it as a doc file, then delete the rtf file.)

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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