Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2007

Tip: Looking for answers? Try searching our database.

Hot to parse RTF String

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert Mileski - 13 Jan 2007 17:55 GMT
Hi,

I have a question.

I want to put a string through VBA in Word, which has a "RTF Syntax" in a
Word document, but parsed, that is formatted.

I'll give you an example:

Sub ParseRTF()
   Dim txtStr as String

       txtStr = "{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0
MS Sans Serif;}}\viewkind4\uc1\pard\lang1031\b\f0\fs17 This is an example of
a String in RTF Format\par }"

End Sub

So, now I have a String with RTF. The problem is now, how can I put this
text in a Word Document, but it should be pasted already formated, not just
as a plain text.

One way of doing this, is putting the String in a .rtf File, and then using
this command: Selection.InsertFile FileName:="C:\TEST.rtf", Link:=True

But I don't want to use a file, because of the time doing a disk read. I
want to paste the formatted string in the document directly.

I want to do this, because I have an MS Access Database, where I store the
RTF Strings in Memo Fields. I want to read them from the database, and
formatted, put them in a document.

Every help will be much appreciated.

Best Regards,
Robert Mileski
Jezebel - 13 Jan 2007 20:48 GMT
Answered elsewhere

> Hi,
>
[quoted text clipped - 33 lines]
> Best Regards,
> Robert Mileski
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.