Reputation: 809
I am trying to add a multi-line text field to a document within Sharepoint but can't currently figure out how to do it. Below is the code i have which works for most of the fields.
SPFile file = folder.Files.Add(*snip*);
file.Item[guid] = stringValue;
file.Item.SystemUpdate(true);
The document adds with no issues the problem is just adding multi line meta data to the file.
Upvotes: 1
Views: 1794
Reputation: 24330
Multi-line fields (such as Keywords) simply expect a carriage return + new line pair to separate out each line:
SPFile file = folder.Files.Add(*snip*);
file.Item["Keywords"] = String.Format("One{0}Two{0}Three", Environment.NewLine);
file.Item.SystemUpdate(true);
Upvotes: 1