MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Link to Create Instance of New Document-based Content Type

  Asked By: Naman    Date: Nov 29    Category: MOSS    Views: 19976

I'd like to code, in html, a link that creates an instance of a Content
Type in a document library from a web part page.

Put another way, I want to steal the action triggerred when you pull
down the New Document menu on the Library Tools' Documents ribbon and
click "My Document Based Content Type."

This needs to open MS Word with the appropriate template as specified by
the content type and save to the appropriate library.

I've seen this:

<A onfocus="OnLink(this)" HREF="/sites/Concept/Templates/Document.docx"
mplates', 'SharePoint.OpenDocuments', false)"> My Document<img
src="/_layouts/images/blank.gif" class="ms-hidden" border=0 width=1
height=1 alt="Use SHIFT+ENTER to open the menu (new window)."></A>

But it doesn't seem to want to work in SPF 2010



1 Answer Found

Answer #1    Answered By: Siobhan Waller     Answered On: Nov 29

Most of the escape characters aren't needed. Drop this in a content editor and
then click on the link

<A onfocus="OnLink(this)" HREF="XXX Item 1 XXX"
onclick="createNewDocumentWithProgID('XXX ITEM 2 XXX', 'XXX ITEM 3 XXX',
'SharePoint.OpenDocuments', false)">Create Instance of Content Type in Specified

"XXX ITEM 1 XXX" = Relative path to template in
\Site\Subsite\library\forms\content type\ folder, i.e.
%20Name.docx" Use %20 for blank spaces.

'XXX ITEM 2 XXX' = Full path to template in \content type folder. Use single

'XXX ITEM 3 XXX' = Full path to host library. In my example above, that would be
'http://MyDomain.com//SiteDirectory/My%20Site/My%20Library'. Again use single

Didn't find what you were looking for? Find more on Link to Create Instance of New Document-based Content Type Or get search suggestion and latest updates.