Only today that I've found that the WSS object model has 2 classes that hold all the IDs of the built-in ContentTypes and Fields.

Instead of doing things like this:

SPListItem item = list.Items.Add();

item["Title"] = "bla la bla";

You can do

item[SPBuiltInFieldId.Title] = "blab la bla";

For the fields you have SPBuiltInFieldId and for the content types SPBuiltInContentTypeId

🙂

LEAVE A REPLY

Please enter your comment!
Please enter your name here