Display a rtf document

D

David Thielen

Hi;

First off, I am using VSTO/C# for my add-in.

From one document, I would like to, when the user clicks a certain
command, bring up a window with a complete rtf document in it that I
have created in code.

Is there a way to do this? Obviously I can create a new document and
walk through setting text and formatting but that would be a lot of
work. I could also write it to disk and open it - but I don't want the
document left on the disk.

And in fact, I would prefer that it was more like print preview mode
where it was viewable and printable - but that's it.

Any ideas?

thanks - dave
 
J

Jonathan West

Word doesn't handle RTF outside the context of a document. Therefore, the
only way I can think of for getting your RTF text displayed is for you to
load it into the clipboard, and then use the Paste method to dump it into a
blank document. That document can then be discarded without saving if
necessary.
 
D

David Thielen

And the simple answer (I should have thought of this before) --- is
use the RichTextBox control.

thanks - dave
 

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