1

I've created a ContentType and I would like it to use the excel spreadsheet template, just like if I create a new document library with the excel spreadsheet template. This is SharePoint 2010.

My content type def looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Document (0x0101) -->
  <ContentType ID="0x01010015aec27014ee4d0c983f5e6547ed707d"
               Name="My Content Type"
               Group="Custom Content Types"
               Description="My Content Type"
               Inherits="TRUE"
               Version="0"
               DocumentTemplate="template.xlsx">
    <FieldRefs>
      <FieldRef ID="{F80289FB-D42D-47A5-B8B8-A75B4CA2C8C6}" Required="TRUE"/>
      <FieldRef ID="{E5544FB6-2168-4A0E-AB75-09E7097FD745}" Required="TRUE"/>
      <FieldRef ID="{8C743462-F786-4373-BF36-9D6A7808C43F}" Required="FALSE" ReadOnly="TRUE" ShowInDisplayForm="TRUE"/>
    </FieldRefs>
  </ContentType>
</Elements>

As you can see I'ved tried using the DocumentTemplate="template.xlsx" but that doesn't work. I appreciate your help.

Thanks.

0

insted of specifying this DocumentTemplate="template.xlsx"> as an attribute under the ContentType node. You should create a new node like this under the ContentType node

<DocumentTemplate TargetName="OpportunityQual.docx" />

Refer this post for more details: http://www.astaticstate.com/2008/02/content-type-feature-with-document.html

  • Thanks Vivek, Thanks a lot for your answer. Do you happen to know what to put as TargetName when you want to use the default template.xlsx that ships with sharePoint? – mortenbpost Sep 22 '10 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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