Automatically save a document template in the right Sharepoint document library#

In a lot of Sharepoint cases, there are document templates that are managed in one particular document library. For example, project document templates have to be managed at one central space, but the saved documents based on that template should be used and stored in a project site. In these cases, when opening a templates, the default "save as" location is the document library in where the template is stored, not the project document template.

This is not what we want, because the documents have to be saved in the project document library. There is a solution for this problem:

Sharepoint comes with a lot of Javascript functions that are stored in the ows.js file. One of these functions is the "createNewDocumentWithProgID" function. This function opens a document in the right program for editing (for example MS Word) and sets the saving location to the given location. So, a url like below, will solve the problem:

<a href="[target document library url]" onclick="createNewDocumentWithProgID('http://[template url]/[template filename]', makeAbsUrl('[target url]/[target filename]'), 'SharePoint.OpenDocuments', false);">Template</a>

This way, the document will be stored in the target location, with the target filename. You have to make sure of course, that the user has reading rights on the template source site. Creating a webpart that automatically loads the templates in the format above, will do the trick. The browser url will automatically become the target doucment library.

Friday, April 29, 2005 10:01:32 AM UTC #     | 

 

All content © 2012, Mart Muller
On this page
This site
Calendar
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Archives
Sitemap
Disclaimer

Powered by: newtelligence dasBlog 1.9.7174.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts