Turns out that they are not as easily manipulated, and examples are very hard to find. After much browsing I found this information though:
http://blogs.msdn.com/sfellman/archive/2007/12/17/issue-programmatically-posting-wss-2007-discussion-list-items-shows-sender-as-system-account-in-outlook-2007.aspx
Use this code:
using Microsoft.Sharepoint.Utilities;
SPListItem item = SPUtility.CreateNewDiscussion(
- .Items, "
item["Body"] = "
item.Update();
There is a corresponding method to add discussion replies:
SPUtility.CreateNewDiscussionReply(item);
Inga kommentarer:
Skicka en kommentar