You are working with document library and requirement comes
in to add one rich text field in the document library. So go to document
library settings and click on add column. Good. Let's go ahead.
Try to add a multi line of text and see what you get when
you scroll down and look for rich text. you do not get the option.
Now this is different. Isn't this? When you go ahead and add
the same multi line field in list, you get rich text setting options but in
document library you do not get this.
Alright let us try something else.
Let us create a site column with multiline text and enhanced
rich text.
Go back to the document library and let's add from existing
site column.
So now we have the rich text multi line field in our
library. so when we upload the document, we should get the RoleDescription
metadata property and we should be good to go to add some rich content.
So let us upload a document and see what happens.
No luck. SharePoint converted the rich text to the normal
text with multi line.
Even if you create a custom document content type and add
site column to that it will not work.
Well then now we need to find out one more route.
So code comes to the rescue here.
Let's add simple code to a web part or event handler or
wherever applicable in your case.
The bottom line is to use this code.
and there you go. execute this code. go back to the library,
upload document or edit property of existing document and see what happens.
I hope this helps.
No comments:
Post a Comment