SPSite site = new SPSite("http://site:port");
SPWeb web = site.OpenWeb();
web.AllowUnsafeUpdates = true;
SPList discussionList = web.Lists["discussion board"];
SPListItem lstItm = SPUtility.CreateNewDiscussion(discussionList.Items, "My New Discussion");
lstItm[SPBuiltInFieldId.Body] = "This is the body of my new discussion";
lstItm.Update();
No comments:
Post a Comment