Content Controls for macOS – Cool Code

Content Controls are an improved form of fillable form field, but the Word for Mac user interface doesn’t include Content Controls for macOS. I show you how to sidestep this limitation to be able to create superior fillable forms.

Microsoft Word for Windows has three different types of fields to use for fillable forms. The oldest of these are Legacy Form Fields, which exist in every version of Word, Windows and Mac, but not DOS, back to the dawn of time. Legacy form fields require the document to be protected for forms, which closes down many formatting options even on unprotected sections. These are the only form fields available in the Mac program interface. Windows version also have ActiveX controls. These generally have a crude appearance. They don’t work at all on Mac versions of Word.

Finally, we have the newest type of form fields, Content Controls. These were introduced on Windows in Word 2007. The collection of controls was expanded a little in 2010 and a little more in 2013. Word 2008 and 2011 can’t use or create them, but in Word 2016 for Mac, the program started honoring Content Controls created in Windows, so they work as expected on both platforms. Unfortunately, the tools to add and modify them are still not in the program.

Content Controls for macOS: What Are They?

While Legacy Form Fields have only 3 types (Text field, Checkbox and Dropdown), there are 9 (or 10, depending on how you count) types of Content Controls. Here’s a look at each type:

Plain Text and Rich Text
Plain Text and Rich Text Appearance

These look identical on the screen. The screen shot shows what they look like unselected (top) and selected (bottom). The Plain Text control is most similar to the Legacy Text form field. All the text has the same formatting and you can’t include other types of content other than text. By comparision, the Rich Text control allows selected text to be bold or italic or a different font. You can insert tables and pictures and even other Content Controls into Rich Text controls.

Picture Control Appearance

Finally! A true picture placeholder for Word! The picture can be set when the control is created. There are options to allow the user to replace it or not. Or it can be left blank (as shown) for the user to add a picture later. You can change the shape from a square using Picture Format>Picture Styles. This choice can also add a soft edge or other visual effects to a photo that the user inserts later.

It’s worth noting that Picture Content Controls only work as inline pictures. To float them and wrap text around them, you need to place the CC in a table cell or frame or some other object that allows text wrapping. These controls come in at 2″ square, but you can set numeric dimensions on the Picture Format tab. (Thanks to Timothy Rylatt for the tips!)

Building Block
Building Block Control Appearance

This is the only Content Control that doesn’t work yet on a Mac. While Building Blocks in the Windows version of Word is the same technology as AutoText on the Mac, Microsoft hasn’t gone the extra mile to make it work on a Mac. The macro further down the page sets the control to work with AutoText (as you almost always should if your template is being distributed to others). But when you click on the control’s AutoText tab, a dropdown list of AutoText entries doesn’t appear like it does in the Windows version.

At least if your Windows client needs it in their template, you can create it on a Mac. AutoText works by grabbing content from the active document’s attached template. If you’re sending a template with AutoText content, the Content Control will find that. If you’re sending a document instead of a template, the Content Control will grab AutoText from the user’s Normal.dotm file.

Check Box
Checkbox Appearance

Similar to the Legacy Check Box form field, but with the added advantage that the filled symbol can be set to other symbols than an X. This control was added in Word 2010, so don’t include one for a client using 2007.

But still no radio buttons? Give me a break, Microsoft! Using elaborate VBA kludges, it’s possible to make a set of checkboxes operate like radio buttons with both Legacy and Content Control versions. But it shouldn’t be so hard!

Combo Box and Drop-Down
ComboBox and Dropdown Appearance

Another similar pair of controls. The Drop-Down is most similar to the Legacy Drop-Down (which MS often refers to as a Combo Box, just to confuse everyone). The Drop-Down restricts users to choosing an item on the list, while a Combo Box allows a user to enter a value that is not on the list.

Date Picker
Date Picker Appearance

While Legacy Text fields have a date option, it’s only to enforce date formatting after a user tries to enter a date. The Date Picker Content Control is way cooler, it’s pops a little calendar for the user to choose a date visually. Handy!

Repeating Section
Repeating Section Appearance

…And the prize for longest prompt text goes to this control. Added to Word 2013, so it won’t work for 2007 and 2010 clients. Clicking on the plus sign in the bottom right corner duplicates the content. There are already a couple of ways to do this, so I think this is strictly for user convenience. Unlike the others, this control spans the page by default, probably because of the long prompt.


No screen capture for this one, because it’s more of an operation than a control. Applying this to a selected set of Content Controls will group them together, so they can be copied as a unit. You can’t include a Rich Text control, which can also be used as a group. If you select controls, then get an error when grouping that a control is “partially covered”, it will usually be about the topmost control. Add a carriage return before, include it when you select, then run the Group macro.

Simple Controls from Keyboard shortcuts

Fortunately, the VBA object model for Word 2016 and 2019 for Mac includes Content Controls. If you’re creating forms for your own use, there is a simple way to create basic Content Controls on your Mac:

  1. In Word, choose Tools>Customize Keyboard
  2. Scroll Categories and pick All Commands
  3. Scroll Commands and pick ContentControlCheckBox
  4. Click inside the Press new keyboard shortcut field and type a key combination. Word will inform you if that combination is already in use. If there is no conflict, or an insignificant conflict, click on the Assign button. Finally, click on OK. The Control key is a good modifier, because all existing keyboard shortcuts with Control are duplicates of ones that also use the Command key.
  5. Click on your document where you would like to see a checkbox, then use the keyboard shortcut. Viola! Instant checkbox!

Repeat the steps for the other Content Control commands. It’s not a bad idea to make a sample document with Content Controls and their shortcuts, for later reference. BTW, keyboard shortcuts are the only customization that can access Content Controls. Equivalent commands for the QAT and Ribbon haven’t been added as of this writing.

Content Controls for macOS: Complex Controls for Clients

The keyboard shortcuts are fine for plain vanilla controls. But they’re so basic, some are useless. Sure you can insert a Drop-Down or Combo Box, but they don’t have any items in the list and there’s no easy way to add them. What we need is more fine-grained control so we can set all the same options that a Windows user can. This is possible by inserting them using VBA.

If you never used macros in Word, start by making the Developer tab visible on the Ribbon. Choose Word>Preferences>View and check Show developer tab. The tab becomes visible when you close the Prefs panel.

On the Developer tab, click on the Visual Basic button (Word doesn’t run Visual Basic, but a very similar language called Visual Basic for Applications. This is VBA, not VB, but why would MS care about an accurate button title?). The VBA Editor opens. In the top left corner is a windows called Projects. If you have a fresh installation, you’ll only see Normal here. If you have Add-ins installed, there will be other project names. Select Normal.

From the macOS menu, choose Insert>Module. Call it ContentControls. A new module page is opened where you can insert macro code. Copy and paste the following code onto that page:

Sub AddRichTextCC()
  Dim oCC As ContentControl
  Set oCC = ActiveDocument.ContentControls.Add(wdContentControlRichText, Selection.Range)
  Set oCC = Nothing
End Sub
Sub AddPlainTextCC()   Dim oCC As ContentControl   Set oCC = ActiveDocument.ContentControls.Add(wdContentControlText, Selection.Range)   With oCC     .MultiLine = True   End With   Set oCC = Nothing End Sub
Sub AddPictureCC()   Dim oCC As ContentControl   Set oCC = ActiveDocument.ContentControls.Add(wdContentControlPicture, Selection.Range)   Set oCC = Nothing End Sub
Sub AddBuildingBlockCC()   Dim oCC As ContentControl   Set oCC = ActiveDocument.ContentControls.Add(wdContentControlBuildingBlockGallery, Selection.Range)   With oCC     .BuildingBlockType = wdTypeAutoText     .BuildingBlockCategory = "General"   End With   Set oCC = Nothing End Sub
Sub AddCheckBoxCC()
  Dim oCC As ContentControl
  Set oCC = ActiveDocument.ContentControls.Add(wdContentControlCheckBox, Selection.Range)
  With oCC
    .Checked = False
    .SetCheckedSymbol CharacterNumber:=&HFE, Font:="Wingdings"
    .SetUncheckedSymbol CharacterNumber:=&HA8, Font:="Wingdings"
  End With
  Set oCC = Nothing
End Sub
Sub AddComboBoxCC()   Dim oCC As ContentControl   Set oCC = ActiveDocument.ContentControls.Add(wdContentControlComboBox, Selection.Range)   With oCC     .DropdownListEntries.Add "Choose an item.", value:=""     .DropdownListEntries.Add "Item 1"     .DropdownListEntries.Add "Item 2"   End With   Set oCC = Nothing End Sub
Sub AddDropDownCC()   Dim oCC As ContentControl   Set oCC = ActiveDocument.ContentControls.Add(wdContentControlDropdownList, Selection.Range)   With oCC     .DropdownListEntries.Add "Choose an item.", value:=""     .DropdownListEntries.Add "Item 1"     .DropdownListEntries.Add "Item 2"   End With   Set oCC = Nothing End Sub
Sub AddDatePickerCC()
  Dim oCC As ContentControl
  Set oCC = ActiveDocument.ContentControls.Add(wdContentControlDate, Selection.Range)
  With oCC
    .DateCalendarType = wdCalendarWestern
    .DateDisplayFormat = "MMMM d, yyyy"
    .DateDisplayLocale = wdEnglishUS
  End With
  Set oCC = Nothing
End Sub
Sub AddRepeatingSectionCC()   Dim oCC As ContentControl   Set oCC = ActiveDocument.ContentControls.Add(wdContentControlRepeatingSection, Selection.Range)   With oCC     .AllowInsertDeleteSection = True     .RepeatingSectionItemTitle = "Repeating Section Item"   End With   Set oCC = Nothing End Sub
Sub AddGroupCC()   Dim oCC As ContentControl   Set oCC = ActiveDocument.ContentControls.Add(wdContentControlGroup, Selection.Range)   Set oCC = Nothing End Sub

Use the Tools>Customize Keyboard command to assign these macros keyboard shortcuts. You can also add them to the Quick Access Toolbar. If you subscribe to Office 365 or have Office 2019, you can also add them to the Ribbon.

If you take a close look at the code, you’ll see there are additional lines on some that allow you to set options for that type of control. As one example, the Date Picker includes options for the calendar type, date format and date language. In use, you would alter these options to suit the client, then run the macro to add a control with those options set.

Content Controls for macOS: Setting the Options

Here’s where you can really customize the Content Controls. These are generic options that can be set for all Content Controls. Rather than bulk up each individual macro, here’s one macro to set the extra options. Set the options in code, select a Content Control that you’ve already inserted, then run the macro. If you’re inserting many controls that have a common setting, like .LockControl = True, add that line to the code for inserting the control to avoid extra steps.

Sub SetOptions()
  If Selection.Information(wdInContentControl) Then
    With Selection.ParentContentControl
      'Sets the appearance to the original bounding box look. For the newer tags look, use wdContentControlTags
      'If you don't need to change a setting, comment it out before running the macro
      .Appearance = wdContentControlBoundingBox
      'Sets the color of the control to a preset color       .Color = wdColorWhite
      'Sets the Word Character style to use for the text formatting. This will fail if you use a Paragraph style or forget to create the style before running this. This does _not_ change the placeholder text appearance, just the entered text that replaces it.       .DefaultTextStyle = "Big"
      'Sets whether the Content Control can be deleted or not. If the control has had .Temporary = True applied, you must reverse that property to True before applying this.       .LockContentControl = True
      'Sets whether the contents of the Content Control can be deleted or not.       .LockContents = False
      'Sets the placeholder text or prompt for the control       .SetPlaceholderText , , "Default Text"
      'Sets the Content Control tag property       .Tag = "Tag"
      'If this is set to true, the Content Control will be removed when the contents are edited.       .Temporary = False
      'Sets the title of the Content Control. This appears on a tab above the control when it is activated.       .Title = "Title"     End With   Else     MsgBox "Please select a Content Control to change its options."   End If End Sub

Perhaps you need to create a date picker in a different language. Starting with the macro above for U.S. English dates, you can modify it to create a French date picker:

Sub AddFrenchDatePickerCC()
  Dim oCC As ContentControl
  Set oCC = ActiveDocument.ContentControls.Add(wdContentControlDate, Selection.Range)
  With oCC
    .DateCalendarType = wdCalendarWestern
    .DateDisplayFormat = "d MMMM yyyy"
    .DateDisplayLocale = wdFrench
  End With
  Set oCC = Nothing
End Sub

Utility Macros

The following macros perform essential functions that may only be occasionally required. First, a pair to toggle all Content Controls between the older Bounding Box appearance and the newer Tags look. The only control that currently displays as a tag in macOS is the Group Content Control. All others appear as plain text in a mysterious field. As a consequence, don’t use this setting for forms to be used on a Mac. Save it for Windows clients:

Sub BoundingBoxAppearance() 'Sets all Content Controls in the document to a bounding box appearance
  Dim oCC As ContentControl
  For Each oCC In ActiveDocument.ContentControls
    oCC.Appearance = wdContentControlBoundingBox
  Next oCC
  Set oCC = Nothing
End Sub
Sub TagAppearance() 'Sets all Content Controls in the document to the tag appearance.   Dim oCC As ContentControl   For Each oCC In ActiveDocument.ContentControls     oCC.Appearance = wdContentControlTags   Next oCC   Set oCC = Nothing End Sub

This macro deletes the existing list of a Combo Box or Drop-Down and replaces it with a new list.

Sub ReviseComboBoxOrDropDownList()
  If Selection.Information(wdInContentControl) Then
    If Selection.ParentContentControl.Type = wdContentControlComboBox Or Selection.ParentContentControl.Type = wdContentControlDropdownList Then
      With Selection.ParentContentControl
        .DropdownListEntries.Add "Choose an item.", value:=""
        .DropdownListEntries.Add Text:="List Item 1", value:="1"
        .DropdownListEntries.Add Text:="List Item 2", value:="2"
      End With
    End If
    MsgBox "Please select a Combo Box or Drop-Down Content Control to change its list."
  End If
End Sub

Finally, one to ungroup a Group Content Control. Switch to Tag view to see Groups, they’re invisble in Bounding Box view. Don’t try to select all group items before ungrouping, it will generate an error. Instead, single-click anywhere inside the group:

Sub UnGroupCC() 'Ungroups a group control
  If Selection.Information(wdInContentControl) Then
  End If
End Sub

For more in-depth reference on these macros, please see Microsoft’s documentation.

Now you’re equipped to send your client top-quality fillable forms with the latest technology. So when your client asks if you can create Content Controls, instead of saying “Huh?”, you can reply confidently “No problem!”

5:23 pm

36 thoughts on “Content Controls for macOS – Cool Code

  1. Hi John,
    I have a below code that fills content control in MS wWord using VBA.
    This code works in windows os but not in Mac OS.

    Can you help me to solve this issue ?.

    Thank you.

    With ActiveDocument
    .SelectContentControlsByTag(“Country”).Item(1).Range.Text = “USA”
    End With

    • This code is working here in both Windows and Mac:

      Sub SetText()
          Dim oCC As ContentControl
          Set oCC = ActiveDocument.SelectContentControlsByTag("Country").Item(1)
          oCC.Range.Text = "USA"
      End Sub
  2. Hi John,

    This is very helpful! I can now send “protected” forms to my students to fill out!

    One question though, how do I change the font color? I mean, obviously I can change the “click or tap here to enter text” to whatever color I want using the menu bar options but as soon as I start typing in the textbox, it switches to black by default.


    • I always create and use Styles in all documents. So I create a style for the Content Control filled text. I apply that style to an ordinary empty paragraph. Then I insert the Content Control. Then when you enter text, it will appear in the style of the surrounding text.

      If you’re using local formatting (select text, use Format font to apply font color), do the formatting to the paragraph first, then insert the CC.

      When the Content Control is first inserted, the placeholder text is formatted with the PlaceholderText character style. This is based on the style into which the CC has been inserted, but with gray text. As soon as you start typing, that will be replaced by your font color.

  3. Hello John,

    Appreciate this post because it’s very helpful. I’m trying to figure out a way how to use it for populating multiple like fields (repeating data). For example, on a process document, I have a title field on separate pages. If I change one title field, the rest should change. The file I have now is set up in Windows with an XML code I followed from this website: I’m using a Mac so I have no way of editing things. I’m trying to do away with that. Looking forward to your response.

    • Since you read Greg’s page, you know that there are lots of ways to make data repeat through a document. Unless the document needs to be locked down for some reason, my preferred method is to create a unique style for the title text, then use a StyleRef field in all the other places that title is to appear (#8 on Greg’s list). It works well, it’s simple and can be done with the program interface on both Windows and Mac.

      With Content Controls, Greg mentions 3 techniques: using Properties, using Simple Links and Custom Mapping. Which are you trying to implement?

      • Hi John,

        I tried the solution where you load a text document file in Windows version of Word and that takes care of the repeating data fields. I can’t seem to find it in that link, but I remember copying it from his site.

        I tried the StyleRef, but I can’t seem to make it work on the text body. It only works if I place it on a header or a footer.

  4. i just don’t get it.. I’m no coder… I’m just a desperate nurse trying to get my work done faster. I’m working on a mac. I need to be able to add a date picker in my forms. I’m welling to learn to code but I have not enough time at the moment. Please help me.. I wish I could send you a screen shot to show you where I’m at in the procedure. Can you please contact me.

    • Here’s the macro modified to create a French date picker:

      Sub AddFrenchDatePickerCC()
        Dim oCC As ContentControl
        Set oCC = ActiveDocument.ContentControls.Add(wdContentControlDate, Selection.Range)
        With oCC
          .DateCalendarType = wdCalendarWestern
          .DateDisplayFormat = "d MMMM yyyy"
          .DateDisplayLocale = wdFrench
        End With
        Set oCC = Nothing
      End Sub
  5. John, thank you. Your samples, tutorials, explanations are a godsend!

    I wondered if you might share a VBA snippet to use for the below scenario.

    A combobox box with a list or display name that, once selected by user, inputs a different text string.

    For example, if I wanted to use a combobox control to show a list of several items that each displays a different corresponding text string when selected (e.g., list item “Property” that when selected by user inputs text, “1 Main Street, City, State, Zip” into the document)?

    Any help or insight you can offer would be immensely appreciated.

    • Please be more specific. Which lines do you think are missing? Each CC code block includes only the lines that are unique to that control. For general-purpose code that applies to all controls, please see the SetOptions macro.

  6. Also, what is the code for “combobox” … I have to use VBA since the combbox feature in MAC will now allow me to add a long text string.
    Many thanks.

    • Sorry, I don’t understand what you mean. Please see the AddComboBoxCC macro for the basic macro to add that control. Perhaps instead of “now”, you mean “not”?

  7. Dear John
    I am also having a problem with drop box in word Office 365 on my Mac. I did not understand completely what should I do and when coping the files there are several boxes. Should I copy content of the first one or all?
    Ih I try to copy content from all boxes it marks also the text outside those gray boxes…
    Is there a help for me??

    Thanks! Best regards.

    • Sorry, but your description of your problem is not clear enough for me to understand. You mention copying files, then copying content. Are you trying to copy a document, a content control, or just the text of the content control?

  8. Dear John,

    Can you please kindly help me out? I’ve ran the “AddRepeatingSectionCC” to the a table row and it’s added an additional row to the bottom of the table. However, unlike the original rows, where I can ‘tab’ from one cell to another, the cells in the additional rows seem to have lost that functionality – it simply tab within the cell increasing each cell; rather than tab over to the next cell when the user fills in the form. Is there a way to fix this? The rows added do not seem to inherit the characteristics of the original row. Your guidance to resolve this will be very much appreciated. Many thanks.

    • Hi John,

      I’ve now realised that the VBA codes uses Content Controls whilst my table uses Form Fields. Is there a way to modify the code for it to work with Form Fields? Thanks very much in advance.

        • I have created a form in MS Word.
          The form consists of a table of 4 columns, which users can use to list information.
          Each of the cell in the table, contains a ‘Form Field’ so users can tab to each cell to fill in the table; but not modify the rest of the document as the form will be protected.

          I want the users to be able to add additional lines to the table if required.
          I used the “AddRepeatingSection CC” VBA which you kindly provided to create a “+” at the end of the table for users to add an additional row to the table.

          The VBA does create the “+” and by clicking the “+”, it does add an additional row to the table.
          However, the ‘tab’ function no longer works in the newly created rows – i.e. users cannot tab to go from one cell to the next cell. Tabbing is now within a cell, making each cell larger; instead of going to the next cell as in the original rows.

          I suspect this is because the table has ‘Form Field’ in each cell rather than “Content Control”. Does the “AddRepeatingSectionCC” VBA works with Form Fields? If it does not, can you let me know if there is an easy way to make it work for Form Fields?

          Many thanks in advance for your help.

          Best wishes,

          • Your form might be easier to use if you use content controls with protected area exceptions, a more sophisticated type of protection that was introduced at the same time as content controls. The old form fields and section-based protection for forms makes a document inflexible by comparison. While it is possible to mix the two technologies, there’s very little technical support available for that scenario. If you’re not able to figure it out, I’m available to consult for US$30 per 15 minute time segment. You would have to email your document so I can see what you’re talking about.

  9. Thanks so much for this information!

    Once you’ve added a drop down box using this method how to do you edit it? At the moment I’m unsure how I can change what they can choose on the drop down menu.

  10. How can I create a text field that is dependent on the results from a dropdown in Word for Mac 2019? My attempts using nested IF” fields doesn’t work properly, despite precisely following the “Help” within the application.

  11. Pingback: Is it possible to create a sort of template/zone to guide others where to insert images in a Word document? - Boot Panic

  12. Hello John, I have added the macro to my mac. How do I change the drop down “word” choices. I know it says “item 1”, “item 2”. Do I need to change those words in the code? Or, is there a way to change what the drop down choices are without rewriting the code?

    Also, if I have to change it in the code, what does that do to my document if I need to use multiple drop down sections?

    Thank you,

    • To change the options that appear in the dropdown, use the macro called ReviseComboBoxOrDropDownList. Edit the code to change the Text parameter to the wording you need to see for each choice. Then select the content control in Word and run the macro. Once the dropdown choices are correct, move on to the next dropdown. Edit the macro, select the dropdown, run the macro until you have set all the dropdown lists in your document.

    • As noted in the article: “This is the only Content Control that doesn’t work yet on a Mac.”

      If you’re getting an error when creating a building block CC, please post the code you’re running and the error message that displays. Include the version of Word you’re using. You can find this in the Word>About Word dialog.

  13. Pingback: Customize existing MS Word Template document's variables & Content Controls

Leave a Reply

*Required fields. Your email address will not be published.

Posting XML? To enter XML code, please replace all less than signs "<" with "&lt;" and greater than signs ">" with "&gt;". Otherwise, Wordpress will strip them out and you will see only a blank area where your code would have appeared.