Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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