Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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" /'>?

share|improve this question

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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