Using VBA to Copy Rich Text Cell Data from Word Table to ADORecordset Field

D

Don

Here is a snippet of code I am working on to copy the rich text
contents of a Word table cell to a field of an an open recordset:

intRowCount = 1
While intRowCount <= intNumRows
strReqNumber =
docNew.Tables(intTableCount).Cell(intRowCount, 1).Range.Text
rstReq.AddNew
rstReq![ReqName] = Trim(strReqNumber)

'**** Next line successfully gets the rich text to the
clipboard
docNew.Tables(intTableCount).Cell(intRowCount,
2).Range.Copy

'**** Have tried both .Text and .FormattedText
rstReq![ReqText] =
docNew.Tables(intTableCount).Cell(intRowCount, 2).Range.FormattedText
'**** Need to get rstReq![ReqText] to accept the formatted
text or find a way to past the clipboard data

rstReq.Update

intRowCount = intRowCount + 1
Wend

The table field, ReqText, is set as rich text in the table definition
and I can manually cut-'n-paste rich text into the table fine.
Fundamentally, my problem appears to revolve around setting the filed
value with ADO.

Any suggestions will be greatly appreciated!

Thanks!

Don
 

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