How To Paste RichText Formatted String into Word with Visual Basic Automation (258513)
The information in this article applies to:
- Microsoft Office Word 2003
- Microsoft Word 2002
- Microsoft Word 2000
- Microsoft Word 97 for Windows
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
This article was previously published under Q258513 SUMMARY With Automation, you can do programmatically almost
anything the user can do manually in Microsoft Word. However, if you have a lot
of text you want to enter and format, it might require a lot of code. If you
can represent your data as a RichText Format (RTF) string, you can often
decrease the amount of Automation code. You can create an RTF string, copy the
string to the clipboard, and then paste it into your document.
This
article walks you through building a simple Visual Basic example that starts
Microsoft Word, creates a new document, and adds some formatted text to it
using a pre-built RTF string.
Modification Type: | Major | Last Reviewed: | 3/23/2006 |
---|
Keywords: | kbAutomation kbhowto KB258513 kbAudDeveloper |
---|
|