reading rich text Data from database into word

P

pdev

Hi,
is there a way to write rich text from a database field to word directly
without having to use intermediate richtext box ocx to first save the text
(from DB) to this ocx and then copy from there to word like what Iam doing
here as follows ?

Do While Not rs.EOF
txtReference.TextRTF = IIf(IsNull(rs("ReferenceText")), "",
rs("ReferenceText"))
Clipboard.Clear
Clipboard.SetText txtReference.TextRTF, vbCFRTF
Word.Selection.PasteAndFormat wdFormatOriginalFormatting


rs.MoveNext

Loop
 
P

Perry

Store the text as OLE object in yr database.
Then use, Word's Insert File (read: Document) to place the "text" (ie the
OLE object/document) in the target document.
Turn on the recorder while manually inserting a file in yr target document,
to get you sample code.

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top