How to automatically create Word documents that include list fields from a custom SharePoint list?

Can I automatically create Word documents that include list fields from a custom SharePoint list?

here is the scenario: - a user list (more than 100 columns) - Word templates (not sure where they are best stored) - The application form will provide data for the templates (or partial data, that is, customer name, sales representative) - a form that will have buttons (i.e. "Create Order Form", "Create PO")

the idea is to be able to create partially populated templates from a user list using a button.

+4
source share
3 answers

You should learn the Word Control Toolkit, which uses the Open XML SDK to achieve what you need.

The main functionality is that you use the Edit Control block in the selected list item to create and populate a Word document with a template that you can select from the drop-down list.

I have successfully used it to create invoices based on a list of contracts.

Here are some links to get you started:

Create documents from SharePoint lists with Open XML content controls

Word Content Management Tool (Codeplex)

Video Demo: Combining SharePoint List Data into Word Documents

Associate Word 2007 Content Controls with Custom XML

+2
source

If you create a document library with custom fields (or better yet, a content type), Office 2007 documents will include fields as document properties. Word includes functions for adding these fields to a document (Insert-> QuickParts-Document Property).

You can automate the placement of elements in a document by adding a document template to your content type.

+1
source

I know that your post is old, but if you are still available, your suggestion may be more detailed:

"If you create a document library with custom fields (or better yet, a content type), Office 2007 documents will include fields as document properties. Word includes the ability to add these fields to the document (Insert-> QuickParts -Document Property). You You can automate the placement of elements in a document by adding a document template to your content type.

0
source

Source: https://habr.com/ru/post/1304909/


All Articles