Solved

Rich Text (RTF) / Word Automation

Posted on 2002-04-15
2
731 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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now