Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Help Save Docs in the Doc Library

  Asked By: Jamie    Date: Apr 17    Category: Sharepoint    Views: 1195

Say I create a document library and tell it to use an Excel.xlt file
as the template for new documents.

The "New Document" hyperlink is:

javascript:WPQ3createNewDocument();


This URL seems to have a curious feature in that the Save and Save As
menu options in the Excel window will save back to the document
library and then further, present the doc library list item so the
user can enter the metadata, i.e. the owner, description and status.

Can anyone please tell me how I can duplicate that function somewhere
else just by using a hyperlink?

What I'd like to do is, on one page, provide you with a link that will
allow you to create a speadsheet using the .xlt template and then save
it into the doc library.


I had some success using the following anchor link:

<A onfocus=OnLink(this) onclick="DispDocItemEx
(this,'FALSE','FALSE','TRUE','SharePoint.OpenDocuments.1')" href
="\\MyServer\MyArea\MyDocLibrary\Forms\MyExcelTemplate.xlt" >New
Spreadsheet From Template</A>

But when I go to save it, it wants to save it in the FORMS folder and
that's no good.

Does anyone know the hack to the WPQ3createNewDocument(); JavaScript?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Ariana Christensen     Answered On: Apr 17

Try dropping this code into a Content Editor Web Part on the home page
of your Web (should work in any default Team Site):
------------------------------------------------------------------

<A href="JavaScript:CreateNewDoc();">New Document</A>
<script type="Text/JavaScript" language="JavaScript">
function CreateNewDoc()
{
var doclib = makeAbsUrl("/Shared Documents");

var strTemplate = doclib + "/Forms/template.doc";
var strSaveLocation = doclib;
var strProgID = "SharePoint.OpenDocuments";
createNewDocumentWithProgID(strTemplate, strSaveLocation,
strProgID, false);
}
</script>
------------------------------------------------------------------
Be sure to change the doclib root relative URL to the document  library
that you want to work with and also set the strTemplate to the template
that you want to create. This should do what you want. Be sure to add
some error handling.

 
Answer #2    Answered By: Darrius Whitfield     Answered On: Apr 17

That Rules!

IMHO this is groovy OfficeXP integration because I can one page
that's a "Forms Central" location and have each form create  an
Office document  in it's own library  with its own owners.

 
Didn't find what you were looking for? Find more on Help Save Docs in the Doc Library Or get search suggestion and latest updates.




Tagged: