dbTalk Databases Forums  

convert RTF memo field to plain text

comp.databases.ms-access comp.databases.ms-access


Discuss convert RTF memo field to plain text in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pa_nk1@hotmail.com
 
Posts: n/a

Default convert RTF memo field to plain text - 03-27-2009 , 01:18 PM






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?



Reply With Quote
  #2  
Old   
Rick Brandt
 
Posts: n/a

Default Re: convert RTF memo field to plain text - 03-27-2009 , 04:50 PM






On Fri, 27 Mar 2009 12:18:06 -0700, pa_nk1 wrote:

Quote:
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?
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


Reply With Quote
  #3  
Old   
pa_nk1@hotmail.com
 
Posts: n/a

Default Re: convert RTF memo field to plain text - 03-28-2009 , 01:03 PM



On Mar 27, 6:50*pm, Rick Brandt <rickbran... (AT) hotmail (DOT) com> wrote:
Quote:
On Fri, 27 Mar 2009 12:18:06 -0700, pa_nk1 wrote:
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?

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
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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.