is there any way to remove the html tags for text in CAML? I have made a custom alert template when sending e-mails that uses a field that looks like this:

<'GetVar Name="DisplayName#{Field}" HTMLEncode="TRUE" /'> and it produces the e-mail:

enter image description here And field body: contains all the html tags: ex <'b'> <'img src='#'> - but i only want the text. I want to remove the html tags in the body field. to make it look like this:

Body: Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Curabitur vitae placerat elit. Donec fermentum placerat tortor vehicula pellentesque. Aenean sit amet fermentum velit. Nunc vitae ultrices enim. Duis posuere pellentesque lectus eu faucibus. Cras venenatis mollis ligula, id pulvinar magna elementum ut. Sed nunc est, posuere non rutrum nec, iaculis ac eros. In congue interdum erat quis tempor.

is that possible using CAML, does it have a <'GetVar Name="DisplayName#{Field}" StripHTMLAndOutputAsTextOnly="TRUE" /'>?

1 Answer 1


I does not look like that it is possible: http://msdn.microsoft.com/en-us/library/ms429081.aspx

A possible work-around could be to maintain a text only site column on the list e.g. via an event receiver hooked up to the Updated and Added events. I know it is not a great solution...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.