Link to Create Instance of Content Type

Sometime, you want to give your user a link to create a document in a library somewhere using a document template tied to one of the library’s content types.

Our new best friends at gave us a head start on figuring it out. I just had to pull out my ASCII character map to decode all the escape characters and found they mostly didn’t matter.  So, using our handy dandy content editor web part, we can drop this code in place to cross this one off our list:

<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 Library</A>

Just replace my place holders as follows:

“XXX ITEM 1 XXX” = Relative path to template in \Site\Subsite\library\forms\content type\ folder, i.e.


 I’m using %20 for blank spaces. You can browse to the folder in Explorer view to be sure you have it right. Just swap the \s in favor of /s

‘XXX ITEM 2 XXX’ = Full path to template in \content type folder. In my example above, that would be:


Use single quotes.

‘XXX ITEM 3 XXX’ = Full path to host library. In my example above, that would be:


Again use single quotes.

I’m not sure what the OnFocus= does for us and I can’t testify to the efficacy of the relative vs. full paths but this format does the trick for me.




Comments are closed.