Linked memo field with extra characters in data

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

Douglas J. Steele

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

John Nurick

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

jarome

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

Douglas J. Steele

Actually, John's idea of finding a way to convert your RTF to plain text is
probably the easier approach.
 

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