Question

First off, I'm new to Sharepoint. With that out of the way, I have a document library based on a custom content type. When working with Sharepoint document libraries some users find the document info panel confusing, and depending on how they open it (in the browser vs the application) it doesn't display at all. I'm trying to simplify the process for them and ensure the metadata gets filled out, so rather than having users create new documents the usual way, I'd like to rework the flow as follows:

  1. User clicks a "New document" link or button.

  2. User is presented with a form to fill out the document metadata (as opposed to launching Word immediately or the upload document form). After they have filled this out, the new document is created with the metadata already saved to it and Word launches, allowing them to edit the document (which, by the way, is based on a Word template that is associated with this particular content type).

From my tinkering it doesn't appear that there is an easy way to accomplish this, though I'm wondering if it may be possible by creating a custom form to capture the metadata and on submission programmatically create the document and use the form post to update the metadata once it has been created. It looks like this may be possible using the REST api? Still another possibility as I see it would be utilize a workflow for this purpose? I see that you can create items via the Workflow Designer, so perhaps the form submission could start the workflow, which creates a document based on the necessary content type and Word template, then updates the metadata with the fields from the form? Do either of these sound feasible? Are there other avenues I should be exploring? I'm hoping to get some feedback that will point me in the right direction.

Was it helpful?

Solution

I found the best way of accomplishing this was to create a workflow and use the workflow initiation form to capture all the necessary meta data, and then create the document via the workflow itself, inserting the corresponding fields from the initiation form into the document columns.

OTHER TIPS

As another option, perhaps you could have your users fill out the metadata within the actual document itself using Quick Parts. This would work if your content type has a custom MS Word document template attached to it. Your users would see the Quick Part as a field that they need to fill out within the form content. When they save the form, the Quick Part saves the data to the metadata property it's linked to in SharePoint.

To create quick parts, navigate to the document template: Library settings > Content Type > Advanced Settings > Edit Template. Place your curser somewhere in the document. In the MS Word ribbon, click Insert > Quick Parts > Document Property > choose the property/metadata you want to link to > save the document > click OK on the content type screen to accept the changes.

I wrote a solution for a customer once that more or less did what you're looking to do. I'll note that they decided to go this route against my recommendation. I generally think it's a bad idea to classify/index a document before you've even created it. In addition to that, you will end up with a lot of abandoned documents in the libraries where you use this functionality...users will create a new doc, classify/index it (...in part or whole), and once in Word abandon the UI and leave this orphaned doc out there.

With all that being said, the general solution pattern for this is as follows:

  1. Create a button in the Ribbon with a Custom Action.

  2. Custom Action launches UI (SP.UI.ModalDialog) that allows end user to index/classify this new document.

  3. Upon submission, a new "blank" document is created with the supplied metadata applied.

  4. Once the document is created, it is launched in edit mode. There is a function in core.js (editDocumentWithProgID2) that can help you with this.

Plenty of reference materials out there on each part of this.

You could disable the "SharePoint OpenDocuments Class" add-on in IE. In chrome this is already disabled since chrome did away with npapi. In Firefox you can disable the "Microsoft Office 2010" plugin - the one that says "This plugin allows you to open and edit files using Microsoft Office Applications"

You will want Office Web Apps set up before you do this.

I establish content types based on the business need and bind the required metadata. Once the content types are set, I bind a document template to the content type so a user can open it directly in the library. Using MS Word Quick Parts, I insert controls into the document template so the metadata values are presented directly to the user. Kind of like filling out a form. To ensure users don't mess up the controls, I protect the section(s) of the document where the controls are located and leave the rest of the document open for editing. When a user populates the metadata value in the document, it's automatically picked-up in the SharePoint column. Simple, straightforward and code free.

Here is an article describing the exact same situation and a resoltuion to it

How to Ensure that Users are Prompted for Document Metadata in Office 365 and SharePoint 2016

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top