Background
Total Access Memo lets you add rich text format (RTF) memos to Microsoft Access with sophisticated editing and spell checking.
Question
Is there a way to remove the RTF formatting code from my data source so that I can store a TEXT ONLY representation of the data?
Answer
Yes there is. To convert all of the RTF text back to plain text, there is a Total Access Memo property entitled .Text. Below are suggested steps to implement an example:
- Create a form and bind it to the RecordSource you want to convert to Plain text.
- Add a Memo Control named TamDemo and bind it field containing the RTF data that you want to convert to Plain text.
- On the Form_Current event, add the code below and edit the code to use the name of the field data source.
- Compile the code and run the form.
Dim objFMSMemo As FMSMemo
Dim strText as string
Set objFMSMemo = tamDemo.Object
With objFMSMemo
' The name of the field you added to the
' recordsource that will hold the plain text
' should replace "myPlainTextField" below.
[myPlainTextField] = .Text ' places the text directly into a field bound to a textbox control on the form.
' OR
strTest = .Text ' place the text into variable for later retrieval.
End With
As you scroll through the records, the code above will replace the RTF version of the control contents with the plain text version. There are other ways to do this programmatically if you do not wish to scroll through each record.
Comments
0 comments
Please sign in to leave a comment.