Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

convert RTF memo field to plain text

613 views
Skip to first unread message

pa_...@hotmail.com

unread,
Mar 27, 2009, 3:18:06 PM3/27/09
to
Is there a way to convert an RTF memo field to plain text easily? By
this I mean using a simple query or possibly some VBA code. This is a
Access 2002 db.

I'm aware this can be done by opening file in Access 2007 and changing
the field property but any other ways?


Rick Brandt

unread,
Mar 27, 2009, 6:50:13 PM3/27/09
to

Actually I would doubt this because 2007 uses HTML for formatted text,
not RTF (even though they use that term).

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

pa_...@hotmail.com

unread,
Mar 28, 2009, 3:03:34 PM3/28/09
to

OK,

I came up with my own code solution to this problem. I have a form
called frmTest with a RecordSource of tblTest. This table has 2 memo
fields: 'memoField' contains the Rich text and 'AnotherMemoField' is a
blank memo field.

On frmTest I bind a Microsoft Rich Control to 'memoField' and a
regular textbox to 'AnotherMemoField'. Then run the following code
from the click of a command button:

Private Sub cmdButton_Click()
'memoField contains the Rich text
'AnotherMemoField contains the plain text after code finishes
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.MoveFirst
Do Until rs.EOF
Me.Bookmark = rs.Bookmark
Forms![frmTest].AnotherMemoField = Forms!
[frmTest].memoField.Text
rs.MoveNext
Loop
rs.MoveFirst 'move back to first record
Me.Bookmark = rs.Bookmark
Set rs = Nothing
End Sub

0 new messages