Solved

Rich Text (RTF) / Word Automation

Posted on 2002-04-15
2
738 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

717 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