I have some code that creates a new Word document in a Document Set and then I want to set the Content Type to be a custom type inheriting from document that I have created.
var newLetter = item.Folder.Files.Add("filename.docx", memStr, true);
newLetter.Item["ContentTypeID"] = library.ContentTypes[FieldValues.ContentType.Letter].Id;
I am getting the following error:
Column 'ContentTypeID' does not exist. It may have been deleted by another user.
I'm doing the same thing with a TXT file in the same library and it works. Is there a way to fix this?
Aucun commentaire:
Enregistrer un commentaire