Extract part of field contents from memo field

S

SF

Hi,

I have a memo field that store formatted text (included <div>), I want to
extract the text only excluding the formmated character like <div>, <font>
etc...).

Is there a way to acheive that?

Regards

SF
 
K

Ken Sheridan

The following function will remove any number of substrings passed into the
function as a parameter array:

Public Function RemoveStrings(strFullString As String, _
ParamArray aRemoveList() As Variant) As String

Dim varString As Variant

RemoveStrings = strFullString

For Each varString In aRemoveList
RemoveStrings = Replace(RemoveStrings, varString, "")
Next varString

End Function

e.g. RemoveStrings("<div>abcd<font>efgh","<div>", "<font>") returns abcdefgh.

Paste the function into a standard module and in a query enter the following
in the 'field' row of blank column in query design view:

MyPurgedmemoField: RemoveStrings([MyMemoField], "<div>", "<font>")

adding any other substrings you want removed to the list.

Ken Sheridan
Stafford, England
 

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