Solved

Rich Text (RTF) / Word Automation

Posted on 2002-04-15
2
732 Views
Last Modified: 2011-09-20
I'm using VS .Net, and am having some trouble with Word Automation.  I have gotten far enough to be able to open up Word, create a new document, and use the "TypeText()" command to display text.  However, what I need to do is be able to add text that is stored in Rich Text Format to the Word Document.

The rich text that I need to display in the Word document is not just basic formatting, either.  There can be lists and other such things in the rich text, so simply parsing the RTF file and setting Bold / Italic / Underline / Font on the Word Document won't work.
0
Comment
Question by:Egore
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 150 total points
ID: 6942260
You need to insert the RTF as a file:

    ChangeFileOpenDirectory "C:\personal\other\testBed\"
    Selection.InsertFile FileName:="p205.rtf", Range:="", ConfirmConversions:= _
        False, Link:=False, Attachment:=False

For example.
0
 
LVL 3

Author Comment

by:Egore
ID: 6942730
That worked extremely well, thanks!  If you hear of a way to do this without having to create a temporary file to store the RTF data first, please let me know.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA color chart bars 12 86
VB6 Compile Compatibility Issue 4 102
Saving history changes to sub form 4 43
Excel Automation VBA 19 71
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question