Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a scenario where a user creates a new Word document (attached to a content type), but doesn't need to open it. The document will be populated by other users later.

Is there a way to avoid the default behavior where a new document is automatically opened in Word? I know I could build a workflow for that, but it seems like an overkill for such a simple task.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

You could use a Document Set with a single document template but it introduces additional functionality (possibly complexity) that you probably don't require.

share|improve this answer
    
Thanks for the idea. I agree that it's more complexity than I need, especially in my case as I plan to stay with Foundation. –  Christophe Apr 26 '11 at 23:07
    
Marking this as answer for MSS. For Foundation, I sticked to my initial idea, using a workflow. –  Christophe Sep 16 '11 at 16:41

Why not to add a button to the document library ribbon, and name it smth like "Create document by template"?

And on click, you can pop out SharePoint ModalDialog with your layouts page for asking some additional info (file name), or simply call your js function and create a document by template (most simple way is probably to use SPFile.CopyTo method to copy template from another document library, which you can hide if you wish).

You can either use standard SharePoint XML for adding ribbon button, or use Fluent Ribbon API (codeplex project, which simplifies ribbon creation).

You will need to add following code into your feature receiver:

    var button = new ButtonDefinition()
    {
        Name = "CreateByTemplate",
        Title = "Create by template",
        Image = ImageLibrary.GetStandardImage(12, 9),
        CommandJavaScript = " .. your js here ..",
        TemplateAlias = "o1"
    }

    var ribbonCustomAction = new RibbonCustomAction();

    ribbonCustomAction.AddControl(button1, "Ribbon.Documents.New", 1);

    ribbonCustomAction.Provision(ReceiverGuid, web, ListTypes.GenericLibrary);

For details, please visit Fluent Ribbon project documentation site, you will need section "Project features => RibbonCustomAction".

share|improve this answer
    
I am really hoping that there's something much simpler and obvious that I am missing - just an option to turn off. When you upload a document, it is not automatically opened, I just want the same behavior for new documents. –  Christophe Apr 26 '11 at 13:23
    
I'm afraid there is no such option. Actually what SharePoint is doing, when New button is pressed: it is only opens MSWord and provides some meta information, like document library url and it's default document template. As far as I know, document is not created until you press Save from MSWord. So, actually, MSWord creates the document, not SharePoint itself. Btw, solution which I provided, was used in a real project and works fine. –  Andrey Markeev Apr 26 '11 at 13:32
    
Anyway, I will try to find some extra information about document creation in SharePoint. –  Andrey Markeev Apr 26 '11 at 13:33

One option is to use a content type and set the document template to a LAYOUTS page. Some of the default content types point to Upload.ASPX and you could do the same to point to your own ASPX that creates the document and does not open it.

share|improve this answer
    
My question is specifically about Word documents. Sorry, I don't understand how pointing to a aspx page would help. –  Christophe Apr 27 '11 at 8:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.