I have a document library with multiple content types of word templates.

In my event receiver I need to choose the right template based on a field of the modified/created list item.

Any ideas how to do that?

  • Is the event receiver running on items in the document library with the templates? Or is it running on items in a separate list? Mar 12, 2020 at 16:51
  • It is running in the document library with the templates Mar 12, 2020 at 17:07

1 Answer 1


I've managed to do that as below:

SPDocumentLibrary lib = (SPDocumentLibrary)web.Lists["listname"];
SPContentType contentType = lib.ContentTypes["content-type-name"];
SPFile spf = web.GetFile(contentType.DocumentTemplateUrl);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.