Linked memo field with extra characters in data

  • Thread starter Thread starter jarome
  • Start date Start date
J

jarome

I link to an external database using ODBC. The link
brings in a memo field that has extra characters like this:

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0
\fnil\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17 Tenant Pays Utilities Direct
\par }

What I want is just the wording "Tenant Pays Utilities
Direct". I tried a =mid() command to extract certain
information but the extra characters at the front vary in
length.

I can't change the originating data, only manipulation in
whatever Access will allow me to do.

Any ideas?
 
If it's always the same characters in front of what you want, (such as
\fs17), you can try using InStr to find where that specific character string
occurs, and then use Mid to get from that spot on.
 
If not, you'll need to use one of various methods to extract the plain
text from the RTF string, e.g.

- use a Rich Text control; assign the string to the control's .RichText
property and retrieve the plain text from the .Text property

- find a VB module or dll that can parse plain text out of RTF.
 
Thanks I'll try that - what are your thoughts about
trailing characters or characters in the text - there are
many of the \fs17 or \par or \b variety that I'd like to
strip out.
 
Actually, John's idea of finding a way to convert your RTF to plain text is
probably the easier approach.
 
Back
Top