Q: RichEditControl.text -> Word.document...

  • Thread starter Visual Systems AB \(Martin Arvidsson\)
  • Start date
V

Visual Systems AB \(Martin Arvidsson\)

Hi!

I have a richedit on my winapp, i want to transfer the text and the format
of the text to the word document i created. But only the text is transfered,
but not the formatting...

Any ideas...

Regards

Martin
 
A

Anushi

Hi Martin,

Try the SaveFile method of RichTextBox class. It enables you to save the
entire contents of the control to an RTF file that can be used by other
programs such as Microsoft Word and Windows WordPad. Look here for details :
http://msdn.microsoft.com/library/d...indowsformsrichtextboxclasssavefiletopic3.asp

If you are using VB6, use the TextRTF property of the RichTextBox control to
save the contents as an RTF file. From MSDN :
This example saves the entire contents of a RichTextBox control to an .rtf
file. To try this example, put a RichTextBox control and a CommandButton
control on a form. Paste this code into the Click event of the CommandButton
control. Then run the example.

Private Sub Command1_Click ()
Open "mytext.rtf" For Output As 1
Print #1, RichTextBox1.TextRTF
Close 1

End Sub
HTH,
Anushi
 

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