.dot templates in SharePoint Document Library
If you upload a Word template (.dot) files into a SharePoint document library, and open it in Word, you will notice Word lets you overwrite the template, rather than create an Untitled Document.
When you select a .dot file in Word's File Open dialog box, Word will simply open the file, not use it as a new file template. Word uses .dot files for templates only when the .dot file is selected from within the File -> New -> From Template dialog box.
So when you click on a document in SharePoint, SharePoint assumes you want to edit it and is similar to opening it using File -> Open; and not File -> New.
21 Comments:
So, how do you get around this?
Exactly.. it's not really bright to add an article when you do not even tell how to correct it.
yeah, brilliant dumbass. Thanks for stating the obvious and sharing it with the worl.
I am having some problems also, i placed a dot file in mine libraries but when I open this one sharepoint opens the file as .dot file and not as a word file.
Any solutions..?
Hi, do you have a soultion for this problem?
(sharepoint opens the file as .dot file and not as a word file.)
Best regards
Bjoern Aanstad
I got around this by creating document libraries solely for template files (.dot, .xlt, .ppt, etc.) and set the default view to Explorer View. Now when users click on a template, it opens a new document based on the template. I also restricted editing of these libraries to a few people in the organization.
This is the worst blog ever! Is there anybody out there, who has (more) information how to solve this problem?
The only people who are ever going to find this blog are the people [like me] who have searched for a solution to this problem.
Grr! What a waste of space/time.
Why don't you point out that the sky is blue and grass is green? At least that is somewhat helpfull to the colour blind.
Add the .dot as the template for your library.
If you have content types enabled, add it as the template for your document type and add the document type to the library.
Then when you use the New menu, it will create a .doc instead of a .dot.
Stop bullying. Write something yourselves instead...
This comment has been removed by the author.
First of all, I feel sorry for anyone who is forced to work SharePoint.
I was tasked to find a work around to this problem at my place of work, and after a day of attacking it from various fronts, I came up with a simple javascript solution. Assuming you jquery 1.2 (or later) in your LAYOUTS folder with the name "jquery.min.js", you can paste the following source code into a content editor web part on the page (or pages) you wish to apply the fix.
<script type="text/javascript" src="/_layouts/jquery.min.js"></script>
<script type="text/javascript">
$( function () {
$("a[href$='.dot'], a[href$='.dotx'], a[href$='.xlt'], a[href$='.xltx']").attr("onclick", "").click( function () {
saveLocation = $(this).attr("href").split("/").slice(0, -2).join("/")
createNewDocumentWithProgID(window.location.protocol + '//' + window.location.host + $(this).attr("href"), window.location.protocol + '//' + window.location.host + saveLocation, 'SharePoint.OpenDocuments', false)
return false
})
})
</script>
This code snippet scans the page for links referencing .dot, .dotx, .xlt, or .xltx files. For each link found, it overrides the "onclick" behaviour. The default save location is set to next directory up from the documents own parent directory (as normally you don't want to save documents in the same location as the templates they're based on).
The secret sauce is the createNewDocumentWithProgID() javascript method; this is the method that the "New"/"New Document" menu uses to generate new documents from templates. The method takes a url to an office template (word, excel, etc) and a url to the default save location.
Anyone with experience with JavaScript can easily craft their own solution. You may even want to put this JS in the websites master page so the fix applies globally.
Cheers,
Tom
I forgot to mention that this works with SharePoint 2007, and although I haven't tried it with SharePoint 2010, it should still work as I believe the createNewDocumentWithProgID() method is in 2010 also.
What a genius piece of code - it worked like a dream and saved me hours of frustration! Thank you.
Great code. Thank you!
That code is pure genius, but it needs to be modified slightly to add .dotm and .xltm extensions for macro enabled templates. There is also some additional info here: http://marriedtosharepoint.com/2012/02/04/need-a-link-to-create-a-new-document-from-an-office-template/
Some good solutions to the problem here I like the explorer view and contenttype solutions, I am a configurator not a developer but the script is a great solution but it is harder to maintain custom solutions.
I had a similar issue where I wanted sharepoint to use a .dot file on a UNC / shared drive. This was a nightmare until I found this article, wher you link to a .lnk file that points to the .dot file on the \\shared\drive
so simple
http://support.microsoft.com/kb/278627/en-us
Tom, I tried it with SharePoint 2013 and works like clock work ... I like you :D
I am a novice with JaveScript. I pasted the code into NotePad and saved it with a file extension ".js" and then put that file in my site assets library. Then on my home page I added a Content Editor web part which links to that ".js" file in site assets. I must be missing something. Any ideas?
Thank you
Post a Comment
<< Home