Word Document auto-generation: Quick Parts and Content Controls

Auto-generation of Microsoft Word documents is a really powerful tool, and there's a few ways to go about it. In this post I'll detail a couple of the underlying Word out-of-the-box features that allow this to happen, and how they integrate with other tools, like PowerAutomate (Microsoft Flow) and SharePoint.

Quick Parts/Custom Properties

Custom properties seem like the most natural way to support Word auto-property-completion. They do work, but with caveats - you have to do a lot of configuration in SharePoint to get them to work, and, of course, your document does need to be stored in a preconfigured document library.

To add a custom property to a document, select File > Info. Then select the Properties menu, and click Advanced Properties:

Accessing Word custom properties

Once in there, you can add a custom property under the 'Custom' tab.

To use this feature to auto-populate SharePoint properties, you then need to have a SharePoint property with the same name, add it to a document library with a default value, and add the document to the library. The SharePoint custom property promotion system then associates the two properties and sets the value in the document.

Check out this ShareGate post for an explanation of how to set it up.

Content Controls

Content controls are a 'developer' feature in Word which allow you to insert user input controls such as checkbox, dropdown, date picker, or just plain text input.

Although they don't integrate directly with SharePoint, you can populate them using Microsoft Flow using the "Populate a Microsoft Word template" action (from the - unfortunately premium - Word Online (Business) connector).

One of the nice things about the Content controls is that they can be populated programmatically (eg. via a Flow) and don't require the user to refresh or "update" the document placeholders when they open the document. Another nice feature is that they can be clearly shown in the document itself - so you can see exactly where placeholders exist within the document.

To get started, you need the Developer tab:

Content Controls in the Developer ribbon

If you don't have the developer tab visible, just right-click on the ribbon, and select 'Customise the Ribbon' to enable it:

Enable Developer ribbon

At this stage I'll refer to the excellent post by Hugo Bernier which describes in detail the process for configuring the document and Flow. Note that the flow can then be customised for external connectors, PowerApps, or other connections.

Summary

I don't think there's an easy solution for auto property replacement. Quick Parts require a lot of set up and a very specific configuration, whilst Content Controls only work when combined with a Microsoft Flow (with premium license). I think we can do better. Watch this space.

Sign up for product launch updates