modifying the format of text in a table's memo field

paparmar

New member
Local time
Today, 12:57
Joined
Apr 17, 2011
Messages
2
I'm trying to remove underlines that might exist in a table field (type MEMO, set to RTF, so the user's formatting is preserved). My plan of attack is to use an update query (pointed at the table) whose "update to" calls a VBA function, passing the name of memo field as "InputMemo". Where I hit a dead end is how to implement the UNDERLINE property (i.e., someobject.underline = FALSE). Here's the code that doesn't compile:

Public Function funRemoveUnderlines(InputMemo As Variant) As Variant
Dim FixedMemo As Variant
FixedMemo = InputMemo
:(FixedMemo.Underline = False:(
funRemoveUnderlines = FixedMemo
End Function

FixedMemo, which is intended to be a container with the "fixed" (no underlines) version of the InputMemo field, is a variable, not an object, which is why FixedMemo.Underline is an invalid statement (this is my interpretation, anyway).

Any fixes or suggestions for an alternative approach? The fact that I need to modify a table field, rather than a form or report control, makes things more complicated, I think.

Thanks.
 
Create an Updatequery and use the replace function to remove the html-tags "<u>" and "</u>"

UPDATE Table SET notes = Replace(Replace([notes],"<u>",""),"</u>","");

Change the bold parts to your tablename and memofield name and run the query, TEST it first on a copy just in case...

JR
 
Thank you JANR. I'll give it a try.
 

Users who are viewing this thread

Back
Top Bottom