Editable Lines on Layouts – Cool code

Lines or rules on a PowerPoint design are such a pain. If you place a simple line shape on a slide layout, it is static content. A slide made from that layout will show the line, but it will not be editable or deletable. So most presentation designers use sample slides that have rules added, so they can be moved or deleted. Clunky! If only there was a way to create editable lines on layouts…


Manually Adding Editable Lines on Layouts

This article came from an email I received from Jacob Liao, who sent a sample showing a rule placed on the layout that could be changed on the slide created from that layout. Here are the steps to create this effect using only the user interface in PowerPoint:

  1. On the slide layout, create a new placeholder using Slide Master>Insert Placeholder. You could use any type, but I tend to use Media placeholders, since they don’t pull in photos that are added to a slide. As a convenience, make the placeholder the width (or height) of the rule that is to appear.
  2. Format the placeholder with a border matching the line or rule you want, giving it the correct color and rule width. Delete the default placeholder text and any bullet.
  3. With the placeholder still selected, choose Shape Format>Edit Shape>Change Shape and choose Callout: Line with No Border.
    Callout Line with No Border for editable lines on layouts
    The placeholder border disappears, but the callout line appears beside the shape, formatted with the shape’s border color and weight.
  4. Drag each end of the callout line to align with the edge of the placeholder. This can be a bit fiddly to get it exact.
  5. Give the placeholder a fill of No Fill and set the height (or width, for a vertical rule) to 0.
  6. Close the Slide Master view, create a new slide from the layout and test your new editable line.

Adding Horizontal Editable Lines on Layouts with VBA

You can really speed up this process by creating these rules with macros. For horizontal rules, start by adding a placeholder that is the width of the rule, with the top edge of the placeholder where the rule should be placed. With the placeholder selected, run this macro:

Sub EditableHorizontalLine()
    Dim oShape As shape

    For Each oShape In ActiveWindow.Selection.ShapeRange
        With oShape
            With .Fill
                .Visible = msoFalse
                .Transparency = 1#
            End With
            .AutoShapeType = msoShapeLineCallout2NoBorder
            .Adjustments(1) = 0
            .Adjustments(2) = 0
            .Adjustments(3) = 0
            .Adjustments(4) = 1
            .Height = 0
						.Decorative = msoTrue
        End With
    Next oShape
End Sub

Adding Editable Vertical Rules with VBA

It’s much the same for vertical rules. Create a placeholder that is the same height as the rule will be, with the left edge of the placeholder at the rule position. With the placeholder selected, run this macro:

Sub EditableVerticalLine()
    Dim oShape As shape

    For Each oShape In ActiveWindow.Selection.ShapeRange
        With oShape
            With .Fill
                .Visible = msoFalse
                .Transparency = 1#
            End With
            .AutoShapeType = msoShapeLineCallout2NoBorder
            .Adjustments(1) = 1
            .Adjustments(2) = 0
            .Adjustments(3) = 0
            .Adjustments(4) = 0
            .Width = 0
						.Decorative = msoTrue
        End With
    Next oShape
End Sub

Doug Popovich wrote about the code above, asking if there was a way to mark the shape as decorative, since it contains no text. So I added the line .Decorative – msoTrue, which does exactly that, saving you the trouble of manually marking the line in accessible decks.

Editable lines on layouts separate you from the competition. If any of this seems too complex, Brandwares is here to help. Message me to consult on your most demanding presentation issues.

Set a Default Template or Theme – Best Practices

In a corporate environment, you normally need new documents to appear with company branding instead of reusing Microsoft’s designs. Here’s how to set a default template or theme so that each new document, presentation or workbook looks like your company guidelines (or your personal preferences).


Template or Theme – Choosing a Format

Templates contain a theme, but a theme is much simpler than a template. You may need to create both types of files. If your goal is to create a unified look in Office, you’ll want to create a theme, then apply it to templates in Word and Excel.

A Theme file contains a Color Theme, a Font Theme and an Effects Theme. It also contains the slide layouts that were in the PowerPoint file when you saved it as a theme. For this reason, you can use a theme as a mini template for new PowerPoint presentations.

Themes provide minimal formatting information for the templates to which they are applied. A theme will supply a set of 12 colors, 2 fonts and a set of visual effects for inserted shapes. It’s possible to add up to 50 custom colors to a theme. Effects themes format the defaults for inserted shapes, but are not editable in any version of Office. I recommend our Flat effects theme, which is more in tune with current graphic design trends than what Microsoft supplies.

When your goal is a full-featured starting point for new files, you’ll want to create a template instead of a theme. Templates can include sample content, typestyles, VBA macro programming and AutoText, depending on the file format. Here at Brandwares, we almost always supply templates rather than themes.


Create a Better Default Template Experience

In Office on both Windows and Mac, Microsoft has decided that the first thing you need when you open an Office program is to be offered a creative choice in what kind of off-brand document you’re going to create today. In a corporate environment, or really any circumstances where you just need to get work done, this is an unneccessary distraction. You really just need to have a default document open so you can get down to business.

If the Backstage or Gallery displays, when an Office program starts, the program will not automatically create a new file from the default template. You would have to have a file open, then press Ctrl + N (Command + N on a Mac) to create a new file from your template. This limits the usefulness of a default template.

In Office for Windows, you’ll get a better default document experience if all the programs do not show the Backstage on starting. In all three programs, choose File>Options>General and uncheck Show the Start screen when this application starts. Once you do that, opening the program will also open a file created from the default template.

Office for Mac features similar Gallery screens that open by default when the program starts. Turn these off. In PowerPoint, choose PowerPoint>Preferences>General and uncheck Open Presentation Gallery when opening PowerPoint. In Word, choose Word>Preferences>General and uncheck Show document gallery when opening Word. Excel is similar: Excel>Preferences>General and uncheck Show Workbook Gallery when opening Excel.


Set a Default Template or Theme in PowerPoint

I’m starting with PowerPoint because it’s the only Office program that can save a Theme file. In Office for Mac, PowerPoint is also the only program that can create a Color Theme,. (To create a custom Font Theme in Office for Mac, please see this article: OOXML Hacking: Font Themes.) A theme created in PowerPoint can be applied to Word and Excel to give a basic uniform look to documents and workbooks. Theme files cannot contain sample slides, custom table styles, VBA code or preformatted Notes or Handout masters. If you need any of those items, create a template instead of a theme.

Unlike Word, PowerPoint doesn’t have a source file that serves as the starting point for new presentations, analogous to Normal.dotm in Word. But you can give it one! Start by making a copy of your template or theme. Templates will have a file ending of .potx or .potm, while themes will end with .thmx. Change the file name to Default Template, leaving the file ending unchanged.

Here are the steps in PowerPoint for Mac:

  1. While holding down the Option key, click on Go in the macOS menu bar and choose Library. Your hidden user Library folder opens.
  2. Navigate to ~/Library/Group Containers/UBF8T346G9.Office/User Content/Themes
  3. Drag the Default Theme template or theme into the Themes folder.
  4. Open PowerPoint and choose File>New Presentation or press the Command + N key combination to create a new presentation. The new deck is formatted per your template or theme.

Microsoft’s June 2024 update changed the location for Document Themes, which is where you must copy your Default Theme file. Here are the steps for PowerPoint for Windows 2019 and earlier editions:

  1. Open a File Explorer window
  2. Copy and paste this text into the address bar:
    %appdata%\Microsoft\Templates\Document Themes
  3. Drag the Default Theme template or theme into the Document Themes folder.
  4. In PowerPoint, use the Ctrl + N keyboard shortcut to create a new file from your default template or theme. Or choose File>New, then click on the Default Theme icon at the upper left end of the row of recently used templates and themes.
    Default Theme icon in PowerPoint for Windows

For users who are on Microsoft 365 or Office 2021 or later, copy the Default Theme file to the new location. By default, this is C:Users\YourActualUserName\Documents\Custom Office Templates\Document Themes.


Set a Default Template or Theme in Word

Setting a template default in Word can be a bit tricky, because Word already has one: the Normal.dotm file. The wrinkle is that Normal.dotm is also the default storage location for user-created content like macros, custom typestyles and AutoText. A minimalist approach is to apply a new theme to an existing Normal.dotm, sidestepping those issues.


Set a Default Theme in Word

A Word-created Normal.dotm always has the Office theme applied to it. You can set a different theme for new documents by editing Normal.dotm and applying a theme file you’ve created in PowerPoint. This is safe for user-created content, as no content is deleted. Custom styles that were based on the Office theme will change appearance, but otherwise keep their characteristics.

Themes are limited in scope, but if your branding goals are limited, that may be enough. Here are the steps for macOS:

  1. With Word open, press Option + F11. The VBA editor opens.
  2. Press Command + Ctrl + G. The Immediate window opens in the VBA editor.
  3. Copy and paste this text into the Immediate window, then press return:
    application.NormalTemplate.OpenAsDocument
    The Normal template opens in Word. Close the VBA editor.
  4. Choose Design>Themes>Browse for Themes, find and select the Theme file you saved from PowerPoint, then click on Open.
  5. Save Normal.dotm, then close it.

Here are the steps for Word for Windows:

  1. With Word open, press Alt + F11. The VBA editor opens.
  2. Press Ctrl + G. The Immediate window opens in the VBA editor.
  3. Copy and paste this text into the Immediate window, then press Enter:
    application.NormalTemplate.OpenAsDocument
    The Normal template opens in Word. Close the VBA editor.
  4. Choose Design>Themes>Browse for Themes, find and select the Theme file you saved from PowerPoint, then click on Open.
  5. Save Normal.dotm, then close it.

Replace Normal.dotm in Word

If your users may have saved macros, styles or AutoText content, make a copy of Normal.dotm before replacing it, then to use Word’s Organizer feature to copy custom content back to the new template. Here is the procedure to replace Normal.dotm in Word for macOS:

  1. Close Word
  2. While holding down the Option key, click on Go in the macOS menu bar and choose Library. Your hidden user Library folder opens.
  3. Navigate to ~/Library/Group Containers/UBF8T346G9.Office/User Content/Templates
  4. Drag in the new Normal.dotm file and confirm that you want to replace it.
  5. Restart Word to test that a default document matches the new formatting.

The steps for Word for Windows are complicated by Microsoft’s June 2024 change to the default location of Normal.dotm. These instructions cover Word 2019 and older editions:

  1. Close Word
  2. Open a File Explorer window
  3. Copy and paste this text into the address bar:
    %appdata%\Microsoft\Templates
  4. Drag the new Normal.dotm file into the Templates folder and confirm that you are replacing the file.
  5. Restart Word to test that a new document matches the new formatting.

As of June 2024, for Microsoft 365 and Word 2021, Normal.dotm has been moved to the Custom Office Templates folder in the user’s Documents folder. The default path is C:Users\YourActualUserName\Documents\Custom Office Templates


Set a Default Template in Outlook

Outlook uses the template called NormalEmail.dotm to set email formatting. It’s stored in the same folder as Normal.dotm. Follow the same steps as for Normal.dotm: close Outlook, edit NormalEmail.dotm in Word (not Outlook), then replace the template. It’s unlikely that NormalEmail.dotm will contain macros, custom styles or AutoText, so you don’t need the precaution of backing up the file before replacing it.


Set a Default Template in Excel

After formatting a workbook with a custom theme, typestyles and any other necessary formatting, save the file in template (.xltx) format with the name Book.xltx.

PowerPoint for Mac Excel steps:

  1. Close Excel.
  2. While holding down the Option key, click on Go in the macOS menu bar and choose Library. Your hidden user Library folder opens.
  3. Navigate to ~/Library/Group Containers/UBF8T346G9.Office/User Content/Startup/Excel
  4. Drag the Book.xltx file into the Excel folder.
  5. Open Excel. In Excel for Mac, opening the program creates a new workbook from your template. You can also choose File>New Presentation or press the Command + N key combination to create a new workbook. The new deck is formatted per your template.

Excel for Windows doesn’t work as well as it used to Book.xltx, so there are more steps:

  1. Close Excel
  2. Open a File Explorer window
  3. Copy and paste this text into the address bar:
    %appdata%\Microsoft\Excel\XLSTART
  4. Drag the Book.xltx into the XLSTART folder.
  5. Open Excel to test.

I also recommend that Windows users add a second copy of Book.xltx to the Custom Office Templates folder at C:Users\YourActualUserName\Documents\Custom Office Templates. Call this one something like Default Workbook. The first time you use it, you’ll need to choose File>New>Custom Office Templates to choose it. After that first use, it will display in the row of Excel templates:

Default Workbook

Here is Microsoft’s page about setting a default Excel template.


Default Template Limitations

In PowerPoint for Windows, you can’t get rid of the Blank Presentation thumbnail. Clicking on that will only get you a Microsoft default presentation. Likewise, in Excel for Windows, you can’t remove Blank Workbook, which also delivers a Microsoft default.

Custom Table of Contents – Best Practices

Most of the time, the Microsoft-supplied Table of Contents samples will work for Word documents. But sometimes a client needs a custom Table of Contents added to their template. This article shows you how to save a custom Table of Contents and ensure that is displayed prominently, so users pick the right one.

The most obvious use case for customization is to create a non-standard TOC that uses the client’s branding. In addition, sometimes a TOC needs to work differently as well as having a distinct appearance.

An example of this might be if a template uses both heading styles (which need to appear in the TOC) and outline numbering styles (which should not be included in the TOC). A default Microsoft TOC will display both sets of styles, so a custom TOC is required.


How Does a Table of Contents Work?

A standard TOC is a collection of hyperlink fields inside a TOC field. If you insert one of the Microsoft-supplied TOC samples, those fields are embedded in a Content Control. This content control is not particularly useful. It gives you a way to change to a different style of Microsoft TOC (not helpful in branded documents) and a slightly more convenient way to update the TOC. You can create a TOC without a content control if you use the Custom Table of Contents command (highlighted in blue) to create it:

Use the Custom Table of Contents command

Tables of Contents usually get their text from text that is formatted with heading styles. The Microsoft TOCs grab all headings that are levels 1, 2 or 3, which is why they are a problem with outline numbering. When you create a custom Table of Contents, it can refer to specific heading styles, like Heading 1. Then, no other styles will be included in the TOC.

Most often, a template that has a custom TOC will have it added to the document already. Since there’s a sample in the file, users don’t need to add one. The sample has the required formatting, the user only needs to add text to the document before updating the TOC.


Create a New Custom Table of Contents

Here at Brandwares, we never use the Microsoft-supplied TOC styles. Instead, we create each TOC from scratch using References>Table of Contents>Custom Table of Contents. Then we click on the Options button and uncheck Outline levels. That prevents other styles that use outline numbering from displaying in the TOC. Finally, we select the specific styles that are supposed to appear.

TOC Options - Outline levels unchecked

If the TOC is to have a heading above with the text “Table of Contents”, you’ll want it to look like one of the document headings styles. But you don’t want it to actually apply that style to the heading: then the first entry to appear in the TOC would be a repeat of the heading directly above it! Fortunately, Word has a built-in styles called TOC Heading that solves this problem. It repeats the appearance of Heading 1, but it’s outline level is set to Body Text, so it will not repeat in the TOC.


Customize Existing TOC Appearance

The look of a table of contents is determined by the styles that are used in it. There are 9 built-in styles called TOC 1, TOC 2, etc. up to TOC 9. Since there are 9 styles, you can create up to 9 levels in a Table of Contents. Or a document can have setup like a Table of Contents, a Table of Figures and a Table of Tables, each of which use three different TOC styles. Each of these styles can have different amounts of indentation, different types of dot leaders between the text and the page number, different line spacing, etc. All the visual formatting will be set in these TOC styles.


Customize how a Table of Contents Works

Besides the visual appearance, you can control how the Table of Contents operates. To do this, you change the field code that tells Word how to display the TOC. To revise the TOC field code, you need to be able to see it:

In Word for Windows, choose File>Options>Advanced. Scroll down to the Show document content section and check the option for Show field codes instead of their values. OK out.

In Word for Mac, select Word>Preferences>View and check the option Field codes instead of values, then close the prefs panel.

The TOC changes to something like this:

{ TOC \o "1-3" \h \z \u }

The brackets are not ordinary curly brackets: they are special characters that begin and end Word fields. So you can’t just type them in on your keyboard. The contents of the field are editable from the keyboard, just not the brackets. At the beginning of the field is the name of the field type, in this case TOC for Table of Contents.

After that are a set of switches (the letters after backslashes). Each switch makes the TOC behave differently. The sample from Microsoft use the \o switch followed by “1-3”. This combinations grabs all text that is set in the built-in styles Heading 1, Heading 2 and Heading 3. After that, the \h switch creates hyperlinks from each TOC entry to the heading that it refers to. The \z switch hides the dot leaders and page numbers if the document is in Web View. And the \u switch gets all text that is set to outline levels 1, 2 or 3. It’s this switch that creates problems when you also have outline numbered lists, since they use the same text levels as heading styles do.

To make a TOC display only Heading 1, 2 or 3, just delete the \u switch. If the heading styles have custom names, then delete the \o switch and the “1-3” text. Instead, use the \t switch. That switch specifies styles name, followed by the TOC level that the style should use. Here’s a TOC field that uses three custom heading styles:

{ TOC \t "Custom Heading 1,1, Custom Subhead 2,2, Custom Subsubhead 3,3" \h \z }

Pro Tip to Display the TOC Field

Select the Table of Contents, plus the paragraph mark immediately below it. Then right-click on the selection and choose Toggle Field Codes. Or just press the combination of Shift + F9. This shows the field codes for the selected area instead of the whole document. If you see a field code for a Hyperlink instead of a TOC, it means you forgot to select the paragraph mark below the Table of Contents.


Word for Windows Insertable Custom Table of Contents

If the TOC is not to appear in the template as a sample, then the user must have a way to insert it when needed. The simplest way to do this is to add the TOC to the template as AutoText. AutoText entries travel with the template, so they are always available in any document created from that template.

The first wrinkle to overcome is that if you simply select the TOC and add it to AutoText, it can be stored with all of the current displayed text. This will be misleading to the user. To prevent this, switch the document or the selected TOC to show the field codes first. Then select the field code and add that to AutoText.

In Word for Windows, follow these steps:

  1. Select the TOC heading, plus the TOC field code and the paragraph mark immediately following.
    TOC Selection
  2. Choose Insert>Quick Parts>AutoText>Save Selection to AutoText Gallery.
  3. In the Create New Building Block dialog, edit the Name field. It’s usually a good idea to include the client name, so their users know this is the TOC they should pick.
  4. Change the Gallery dropdown to Table of Contents.
  5. In the Category dropdown, choose Create New Category.
  6. In the Create New Category dialog, type in a name like _Client Name. The underscore preceding the name makes the entry pop to the top of the list
  7. .

  8. Double check that the Save in dropdown is the name of the template to which you’re adding this TOC. OK out and save the template.
  9. On the References tab, click on the Table of Contents dropdown and you should see something like this:
    Custom Table of Contents in TOC Gallery

Word for Mac Insertable Custom Table of Contents

You can achieve the same result with Word for Mac, but Microsoft makes it more difficult, since they omitted the Create New Building Block dialog. I’ve written previously about hacking AutoText entries to place them in the correct AutoText Gallery. But here’s an easier way, using a VBA macro.

Here’s the macro listing:

Sub AddTOC2Gallery()
    Dim oTemplate As Template
    Dim oBlock As BuildingBlock
    
    Set oTemplate = ActiveDocument.AttachedTemplate
    
    Set oBlock = oTemplate.BuildingBlockEntries.Add( _
        Name:="Client Name TOC", _
        Type:=wdTypeTableOfContents, _
        Category:="_Client Name", _
        Range:=Selection.Range)
End Sub

This macro will work with the template that will contain the TOC, or a document attached to that template. Yes, we did test this in macOS and Windows, so if you have problems running it, the issues are at your end.

Switch the document or the selected TOC to show the field codes first. Then in Word for Mac, follow these steps:

  1. Edit the macro, changing the text in double quotes to suit your client.
  2. Select the TOC heading, plus the TOC field code and the paragraph mark immediately following.
  3. Run the macro.
  4. Save the template.
  5. On the References tab, click on the Table of Contents dropdown and you should see something like this:
    Custom Table of Contents in Word for Mac

Further Reading

For more detailed pages about Word TOCs, please see Generating Table of Contents in Word. It’s also worth reading Susan Barnhill’s TOC Tips and Tricks and TOC Switches. Though the Barnhill articles are old, they contain obscure information that is still relevant, like how to set up a TOC that doesn’t depend on styles or outline levels.

OOXML Hacking – Lighting Controls for 3D

Office has the abilty to insert 3D models and to create 3D shapes. Both of these using lighting, but the Office interface does not include any lighting controls. To change 3D lighting, you have to hack the XML.

There is very little documentation online for 3D lighting in OOXML aside from the Microsoft pages at 2.31 http://schemas.microsoft.com/office/drawing/2017/model3d. The am3d element that represents 3D models does not appear in the older ECMA-376 reference that defines the Office file formats. ECMA 376 has been superceded by ISO/IEC 29500-1:2016.

When a 3D model is inserted in an Office document, the model file is storeed in the media subfolder, along with a PNG rendering of the view of the model when the document was saved. The PNG is displayed when the document is re-opened and serves as a fallback image when the file is viewed in an earlier version of Office that doesn’t support 3D models.

The rendering information for the model is stored in the document, not in the embedded model file. In Word, the rendering information is stored in word/document.xml. In PowerPoint, it is kept in ppt/slides/slideX.xml, where X is the slide index number. In Excel, look xl/drawings/drawingX.xml.

3D models use scrgbClr parameters for lighting color with numbers expressed in a percentage. But unlike scrgbClr elsewhere in Office, the syntax is not r=”50%” g=”50%” b=”50%”. Instead, use whole numbers with three zeros added, so 50% becomes 50000: <a:scrgbClr r=”50000″ g=”50000″ b=”50000″/>

Here is a typical lighting section for a 3D model or shape:

<am3d:ambientLight>
    <am3d:clr>
        <a:scrgbClr r="50000" g="50000" b="50000"/>
    </am3d:clr>
    <am3d:illuminance n="500000" d="1000000"/>
</am3d:ambientLight>
<am3d:ptLight rad="0">
    <am3d:clr>
        <a:scrgbClr r="100000" g="75000" b="50000"/>
    </am3d:clr>
    <am3d:intensity n="9765625" d="1000000"/>
    <am3d:pos x="21959998" y="70920001" z="16344003"/>
</am3d:ptLight>
<am3d:ptLight rad="0">
    <am3d:clr>
        <a:scrgbClr r="40000" g="60000" b="95000"/>
    </am3d:clr>
    <am3d:intensity n="12250000" d="1000000"/>
    <am3d:pos x="-37964106" y="51130435" z="57631972"/>
</am3d:ptLight>
<am3d:ptLight rad="0">
    <am3d:clr>
        <a:scrgbClr r="86837" g="72700" b="100000"/>
    </am3d:clr>
    <am3d:intensity n="3125000" d="1000000"/>
    <am3d:pos x="-37739122" y="58056624" z="-34769649"/>
</am3d:ptLight>

The first section is am3d:ambientLight that controls the ambient (background directionless) light. Set the color with am3d:clr and the intensity with am3d:illuminance. The illuminance n and d parameters represent the numerator and denominator of a ratio. So the default values of n=”500000″ d=”1000000″ are equivalent to 1/2 or 50% brightness.

After that, the are three point lights (am3d:ptLight). You don’t have to use all three. You can delete them from the XML, comment them out or use the enabled parameter to turn them off:

<am3d:ptLight rad="0" enabled="false">

The rad parameter sets the radius of the light. The units are EMUs (English Metric Units), where 1 inch has 914,400 EMUs and 1 centimeter equals 360,000 EMUs. Set this number in the millions to have a noticeable effect.

You can also add more point lights, but usually three is enough. The color and intensity parameters work the same way as the ambient light.

The other major parameters are for the position of the lights. The left-right position is set by the x number. 0 is dead center, positive numbers move the light to the right and negative numbers to the left. The y number controls the position up and down, while z controls the in-out third dimension. This line would place the light inside the model:

<am3d:pos x="0" y="0" z="0"/>

The pos units are also EMUs. Use tens of millions to notice the effect.

After making changes to the XML and re-opening the presentation with the model, the appearance will be the same as before you edited it. This is because PowerPoint displays a PNG of the model, created when you save. To display the revised lighting, you must make a small change to the model so PowerPoint updates the appearance.

Graphics Over Placeholders – Best Practices

Back at the dawn of time, when PowerPoint was first being programmed, a fateful and incorrect decision was made. Placeholder content would always appear in front of static content, regardless of how placeholders and other content were stacked on the layout. This has led to countless bald designers, from them tearing out their hair because there’s no way to place static graphics over placeholders. Here are 5 ways to work around this problem.


The Locked Graphics Graphics Over Placeholders Workaround

One way to circumvent this design flaw is to create a placeholder on the layout as usual. Then create a sample slide from it. Place the logo over the photo and lock its position in the XML. Here’s my article on how to do that: OOXML Hacking: Locking Graphics. This allows the user to replace the placeholder content while keeping the logo in front.

The disadvantage is that you can’t create a new slide from the layout. Instead, the user must copy and paste the sample slide to create another one.


The Background Picture Fill Workaround

If you’re trying to create replaceable background photos, there’s another method. Don’t place a picture placeholder on the layout. Instead, just place the graphic there. In use, the user right-clicks on the background and chooses Format Background. On the Format Background task pane, choose Picture or texture fill, then click on the File button and choose the background photo. The logo will stay on top.

The disadvantage to this technique is you have to include instructions to the end user, who may never have used a picture fill previously. My thanks to Jaakko Tuomivaara of Supergroup Studios in the UK for this tip.


Graphics Over Placeholders: The Placeholder Picture Fill Workaround

This works with any size photo, it doesn’t have to be full-frame like the previous hack. No copy and paste, no instructions required. I heard about this one from Joshua Finto (Make It So Studio in Austin, TX).

On the layout, insert a picture placeholder to hold the photo. Then add another placeholder on top, sized to exactly the same size as the logo. I use Online Image placeholders because they are rarely used, using a common placeholder type risks content being placed in it if you change layout types. Remove bullets, if there are any, and type a space character so no placeholder text appears.

In the Format Picture task pane, click on Picture or texture fill, then on the File button and fill the placeholder with the logo. Create a slide, place a photo and voila! The logo appears over top of the photo! After creating this, it’s wise to lock the placeholder in XML on that layout, to prevent distortion by the user playing with it. OOXML Hacking: Locking Graphics. EMF, SVG and transparent PNGs are all good logo formats for this application.


The Holey Placeholder (Windows)

For simple graphics, or logos contained in a simple shape like a circle or square, create a logo-shaped hole in the placeholder. Here’s how to do this in Windows:

  1. On the layout, create the picture placeholder.
  2. Insert the logo as an EMF vector file, then ungroup it twice, confirming with PowerPoint that you want to do this. This changes it from a placed picture to a set of vectors embedded on the layout.
  3. With the logo parts selected, hold the Shift key and click on the placeholder.
  4. Choose Drawing Tools Format>Merge Shapes>Subtract.
  5. Fill the background, or a shape placed behind the logo hole, with the logo color.

2024 Edit: I don’t know if this is a temporary bug, or a permanent change, but we’ve been seeing that using Merge Shapes on a placeholder changes it to a freeform shape instead remaining a placeholder. If you see that happen, you have to fix it with an OOXML hack. Find the shape on the slide layout and look for this line:

<p:nvPr userDrawn="1"/>

Replace it with this:

<p:nvPr>
    <p:ph type="pic" sz="quarter" idx="99"/>
</p:nvPr>

Make sure the idx number dosn’t conflict with any other shapes.


The Holey Placeholder (macOS)

If the logo is in a rectangle or circle, use this method in macOS. (It will work in Windows as well.) Place the logo over the placeholder, then draw a PowerPoint shape exactly the same size as the logo, placed over the logo precisely. Select the shape and the placeholder, then use Shape Format>Merge Shapes>Fragment, then delete the shape to reveal the logo-sized hole in the placeholder. For some reason, Merge Shapes>Subtract works differently on a Mac, deleting both the shape and the placeholder, but Fragment still get the job done. Thanks to Ute Simon for suggesting this method in the comments.

A variation on this that can be more detailed is to place a copy of the logo above the placeholder. Then, shape-by-shape, use the logo over the placeholder with the Combine variant of Merge Shapes to knock holes in the placeholder. Then add colored shapes below the placeholder to “fill” the holes. If you have compound shapes (like the letter O or A), you’ll have to release the compound shapes, then connect the inner shape with the outer one. Here’s what the end result looks like in Illustrator.

Outside line connected to inside to simulate a compound shape
Modifying compound shapes to place graphics over placeholders

If you see the placeholder change to a freeform shape, use the OOXML hack in the previous section to fix it.


Graphics Over Placeholders: The ActiveX Hack

I’m including this for completeness, but it’s the least desirable workaround, as it only can be created in PowerPoint for Windows.

  1. Choose View>Slide Master and choose the master or the layout to which you want to add a graphic.
  2. On the Developer tab, choose the Image control from the Controls group.
  3. Click on the Enable ActiveX button when the Microsoft warning appears.
  4. Draw the Image control to the size and postion the graphic will be.
  5. Right-click on the control and choose Property Sheet.
  6. Set the PictureSizeMode property to 3 – fmPictureSizeModeZoom.
  7. Beside the Picture property, click on None, then click on the three-dot button that appears.
  8. Select the graphic. The primary format choices are EMF, WMF, JPG, GIF and BMP. You cannot use a PNG file.

This process will fill the control with the chosen graphic, and the control will float above a placeholder in Slideshow mode.

There are several down-sides to this method:

  • If the graphic doesn’t fill the rectangle of the control, a light gray background will display in the unfilled area in PowerPoint for Windows
  • In PowerPoint for Mac, an ActiveX warning pops up every time you open the deck.
  • The graphics still fall behind the placeholders in Edit (Normal) mode. They only pop to the front in Slideshow mode.
  • In PowerPoint for Mac and PowerPoint for the web, some opaque white EMF shapes become transparent.

Thanks to my readers who have added some useful suggestions!

Automated Word Master Documents – Cool Code

Word Master Documents are a useful feature with a problem. The master document along with its subdocuments can easily get corrupted, sometimes losing the whole collection of Word files. Word professionals will normally advise you to steer clear of them, for this reason. Here’s how to create automated Word master documents that make this feature safe to use.

When you have a collection of Word files, perhaps from disparate sources, and you need to print them or save to PDF with a common table of contents, Master Documents are a good solution.

In my opinion, the real problem is that Master Documents are work to assemble. When you’ve put all the effort in to create one, it’s so tempting to keep it as a permanent collection. But over time, some of the subdocuments need to be revised. That’s when the heartbreak begins, because editing the subdocuments while they are part of a master document can easily corrupt part or all of the collection of files.


Automated Word Master Documents

I’ve created a Word template with a VBA macro that automates the creation of a master document from a folder full of Word files. If the master document is easy to create, then it’s easy to delete when you’re done printing. And that’s exactly what you should do: use the to create temporary master documents, print or save to PDF, then put the master file in the Trash. The folder of Word files that were the source of the subdocuments will be untouched and uncorrupted.

The next time you need to print, simply run the macro again. Create a new master, print it, delete it. This is the safe way to use this powerful Word feature.

The template works with both Windows and macOS versions of Word. You can use the file as a standalone template for occasional use. Double-click on it to create a fresh Word file. Click on the Insert tab, then on the Insert Subdocuments icon at the right end of the ribbon. Choose the folder that contains your Word documents. After the subdocuments are added, add a table of contents, if you like. Print or save to PDF, then delete the automated Word master document.

You can also use the template as an Add-in. This is handy if you often create master documents. See the instructions that accompany the template to learn how to install it. Then, whenever you open Word, the Insert Subdocuments icon will appear at the right end of the Insert tab.

Add Subdocuments command

Installing as an Add-in has the advantage that you can easily use a preformatted Word file that already has a table of contents set up ahead of time. You can create, print and delete an automated Word master document in a matter of seconds.

Here’s the link to the download: Automated Word Master Documents Assembler with Instructions.

Please note: You might ignore the instructions to delete the master document after printing. You might corrupt your files. Because of this potential problem, use this add-in at your own risk. We are not responsible for document corruption or data loss in your documents.

PowerPoint Font Embedding – Best Practices

Font embedding in PowerPoint is great, when it works. But macOS users can have mysterious problems that are hard to diagnose and even harder to fix. This article sorts out the most common PowerPoint for Mac font embedding issues and how to prevent them.


Some of Your Fonts Cannot Be Saved

The client has asked that the presentation be saved with the corporate fonts, to make distribution easier. On your Mac, you choose PowerPoint>Preferences>Save and check the Embed fonts in the file option, along with the Embed all characters sub-option, so the deck can be edited. Then you choose File>Save As to get the fonts embedded. But when you click the Save button, you get a dialog that reads: Some of your fonts cannot be saved with the presentation. Save the presentation anyway?

PowerPoint font embedding problem

First, trying fixing this with PowerPoint’s Edit>Find>Replace Fonts utility. If that works, you’re good to go. But if it doesn’t, you’re probably dealing with a bullet font problem.

When you create a custom bullet in PowerPoint for Mac, PowerPoint uses the macOS Emojis & Symbols utility for picking the bullet. But the Emojis & Symbols dialog doesn’t immediately tell you which font is being used. You have to click on a sample in the Font Variation area to check the typeface. If you don’t choose a font variation, the Emojis dialog will give you a symbol from one the system fonts.


System Font Regular Can’t Be Embedded

When you first try to enter a custom bullet, the Emojis & Symbols dialog appears in condensed form:

Condensed Emoji & Symbols dialog

It’s nearly impossible to insert an embeddable bullet from this dialog, as only macOS system fonts are displayed. Instead, click on the expander icon in the upper right corner (circled in red) to view the large form of the dialog:

Emojis & Symbols large dialog

A bullet is selected, and the preview in the upper right corner is labelled BULLET. When the font name is not displaying here, you are inserting a non-embeddable bullet from an Apple system font. Saving the file displays this dialog:

Incompatible format for PowerPoint font embedding
System Font Regular isn’t an actual font. It’s a pointer to whatever font macOS is currently using to display operating system text. The font can change between releases of macOS, but the pointer retains the same name.


Unsupported Font File Format

The key to choosing an embeddable bullet is to always choose one from the Font Variation panel in the lower right side of the dialog. But not all of those variations will work! Any font with Apple in the name is formatted as an AAT (Apple Advanced Typography) font. Here, I’ve chosen Apple SD Gothic Neo Regular as the bullet font:

AAT font choice

But when I save, I see this:

Unsupported font file format

AAT fonts can’t be embedded in PowerPoint files!


PowerPoint Font Embedding – What Works

All the other fonts that I’ve tried in the Font Variations panel can be embedded. Here, I’ve chosen Arial:

Arial Font Variation

The file saves! No errors!

Here’s your working procedure for custom bullets in macOS:

  1. Always expand the Emojis & Symbols dialog to full size.
  2. Always choose a bullet from the Font Variations panel.
  3. Never choose a bullet from a font that has Apple in the name, nor one that is called System Font Regular

I haven’t tested every font, so there could other than cause issues. If you find one, please write to me and I’ll update this article.

Keep in mind that fonts can also have embedding permissions set by the foundry that prohibit embedding, so these would be a poor choice for use with Office. But that’s an issue in Windows as well as macOS


PowerPoint Font Embedding – Fixing a Problem

You got the dreaded Save with Fonts dialog, and you’ve tried Edit>Find>Replace Fonts. The dialog still appears. What do you do now? That’s a real problem in PowerPoint for macOS.

In Windows, I fix these issues with the following steps:

  1. Open the file in PowerPoint, choose Save As and set the Save as type dropdown to PowerPoint XML Presentation (*.xml) and click on Save. This saves the deck as one giant XML file instead of the usual format of many small XML files tucked into a Zip archive.
  2. Open the XML file in a text editor. NotePad will work but a real coding editor like NotePad++ or Microsoft Code is better.
  3. Do a Find and Replace, finding typeface=”System Font Regular” (substitute the problem font name) and replacing it with typeface=”Arial” (substitute a known embeddable font name).
  4. Save the file, open it in PowerPoint, then resave in normal .pptx or .potx format.

Unfortunately, Microsoft has not given PowerPoint for Mac the XML single-file format. So the fix requires that you check each bullet in the slide master, slide layouts and slides. PowerPoint does not have a way of seeing what the font is for existing bullets, so you have to slog through and replace every damn one! Yuck!

Out of time and no access to PowerPoint for Windows? Send the file to us, and we’ll do the fix for you.

Word for Mac Content Control Add-in

After 15 years, I got tired of waiting for Microsoft to provide Content Controls in Word for Mac. So I wrote a VBA add-in to do it. The Word for Mac Content Control Add-in is free if you subscribe to this blog. There’s no installer (Apple’s sandbox requirements for automatic installation are onerous.), but I provide installation instructions.

Content Controls are a superior way of creating forms, easier to create and use then the Legacy Form Fields that are built into Word for Mac. In a previous post, I’ve written about how you can insert content controls using VBA: Content Controls for macOS – Cool Code. But using VBA requires more technical ability than the average Word user has. So writing an add-in makes these controls available to a much wider group of users.

The new content controls appear on Word’s Developer tab:

Developer tab showing Content Controls

The Properties button opens a dialog that allows you to set the items relevant to that type of control:

The Properties dialog


Current issues with this Content Control add-in:

  • In Word for Windows, you can set a separate character style for the control. The VBA commands for sorting styles don’t do the same thing as the Word interface, so I haven’t been able to make this work the same as in Windows. Using my Content Control add-in, the content controls currently take on the style of the paragraph in which they are inserted, except for the Date Picker which displays Times New Roman (?!) when a date is selected.
  • The color for a control can be set to the same colors as in Windows, but there isn’t a custom color input yet.
  • If and when Microsoft gets around to adding content controls, the checkbox will probably select checked and unchecked characters from the macOS Emoji & Symbols dialog. Unfortunately, that dialog includes many system fonts that can’t be embedded in a file (this is a big problem with choosing bullets in PowerPoint, but that’s material for a different article). So I’ve created a subset of checked and unchecked symbols that can be used in checkboxes. These characters will work as expected and can be embedded in a template or document.
  • The properties dialog in the Content Control add-in can’t preview the checkbox characters, because there is no way for VBA to retrieve the symbols currently used by a checkbox.
  • The date picker should be able to use a world-wide variety of locales and calendar types. I haven’t been able to program the system calls to macOS to get this information yet. The date picker currently uses U.S. defaults for date formatting. Using Microsoft date formatting codes (dd-mm-yyyy, etc.), you should be able to set up dates for other languages based on a Latin (Western) script. This is one of the items that needs testing in other languages.
  • A known error occurs if you try to insert a Content Control into an old Word file in .doc format. You’ll see an error like Run-time error 445: Object doesn’t support this action. Update the file to .docx format to fix the issue.
  • A few users get error messages when trying to modify existing content controls. To date, we have not been able to reproduce, and thus solve, this bug. If you get an error, please post a comment including your processor info (Intel or Apple chip), macOS version and Office edition.

You can get a free copy of the add-in by subscribing to this blog. If you’re already a subscriber, please write to me at the email in the right-hand column, and I’ll send it to you. Please note, we do not send to disposable email addresses.

Most Recent Office You Can Run – Best Practices

As Apple and Microsoft release new operating systems, it’s no longer possible to install the latest version of Office on your old computer. Here’s is a list of the most recent Office you can run for the operating system you have, plus where to find it.


Most Recent Office You Can Run on macOS (Updated for 2024)

Rant alert! Microsoft supports the last three operating systems in both Windows and Mac. Unfortunately, Apple has a policy of releasing a new operating system every year, whether we need it or not. The result of these two business decisions is that there are rafts of perfectly serviceable Macs out there that can no longer install the current version of Office. It looks like Apple intends us to toss them and buy new ones. Another case of lip service to environmental sustainability. Rant over

If you buy or subscribe to Office for Mac today, you’ll only find the current versions of Microsoft 365 (the subscription version) and Office 2024 (the retail edition) to be easily available. But Microsoft maintains a page of older installers at Update history for Office for Mac. All of them can be activated under a current Microsoft 365 subscription or Office 2024 license.

Please note that all of these are final releases: there will be no security updates to follow. Be careful when downloading Office files from the interweb.

As of October 2024, the current crop of obsolete Macs are those that can only run Monterey (macOS 12). These are machines that are around 10 years old, but are completely useable for applications like Office. The last Office version that Monterey can run is 16.89.1. At the History page, look for the Office Suite Installer, with or without Teams, dated September 17, 2024. Do not download the updaters for individual programs! Download the Office Suite installer!

Then run the downloaded installer. After installing, normally Microsoft AutoUpdate fires up and installs the final 16.89.2 version for Outlook. Wait until it finishes, then open Applications and run one of the Office apps.

Prompt to sign in.

You’ll see a dialog prompting you to sign into your account. Enter your name and password.

Enter your Microsoft Account email and password.

If you’re a Microsoft 365 subscriber, that should be the end of the process. Your software will be activated and you’re good to go.

If you have purchased multiple permanent license editions, you’ll see a dialog asking to to choose which license to apply. Office 2019, 2021 and 2024 no longer have separate licenses for Mac and Windows, so at this point it possible to switch Office 2021 (for example) from Windows to macOS or vice versa.

Choose an Office license to use with your installation.


Older Editions of macOS

Big Sur (macOS 11) can run Office 16.77. At the History page, look for the Office Suite Installer, with or without Teams, dated September 12, 2023. Reminder: Do not download the updaters for individual programs! Download the Office Suite installer!

Catalina (macOS 10.15) can run Office 16.66. At the History page, look for the Office Suite Installer, with or without Teams, dated October 11, 2022. Reminder: Do not download the updaters for individual programs! Download the Office Suite installer!

Office for Mac Update History

Catalina was the first OS to require 64-bit software. This requirement made Office 2011 obsolete, since it’s 32-bit. But Office 2011 is still a useful edition in macOS. It can still do things that were permanently removed from later versions of Office. So you might want to stick with Mojave and install the newer Office that goes with it. (There’s no problem in having Office 2011 and a later version installed on the same computer.) In this scenario, download and install the 16.54 version dated October 12, 2021.

One of my favorite Macs is my 17″ MacBook Pro. It’s the machine that travels with me, but it’s 12 years old and can run only High Sierra. The most recent Office you can run on this computer is 16.43, dated November 10, 2020.

There’s a pattern here: Apple releases new operating systems in the fall, usually in September or October. The Office version that Microsoft releases the same month is the last one for the fourth-oldest macOS. I don’t have any machines running Sierra, but if I did, I would try the October 15, 2019 edition of Office 16.30.

As I mentioned earlier, you can run an older version of Office on an older computer. Since Office 2008, the file format has remained pretty constant, so the software can still be useful. You can install Office 2011 under Mojave or earlier, while Office 2008 can be installed under El Capitan and earlier. These versions can co-exist on a Mac with a newer version (or with each other), though Microsoft’s History page only goes back to 16.27 from July, 2019.


Most Recent Office You Can Run on Windows

Under Windows, the situation is easier, as Microsoft waits about 3 years between operating systems. Plus Windows isn’t as finicky about the hardware it runs on. I have an old Mac Pro from 2006 that can only run OS X Lion and Office 2011, but under Boot Camp it does either Windows Vista and Office 2010, or Windows 7 and Office 2016. Windows 8 is likewise limited to Office 2016, while Windows 10 (now 9 years old!) can run the current version of Office 2021 and Microsoft 365. You have to have a really old Windows computer to be unable to run a useable copy of Office.

PowerPoint Icon Gallery – Cool Code

Years ago, Ken Puls of the excellent Excelguru site published an Excel add-in that displays the icons built into Excel. This reference is useful for any programmer wanting to repurpose built-in icons to use with their own code. Here’s where you can download the original: Office 2007 Icon Gallery. His version has gradually become outdated as Microsoft has added more icons to the software, and there was no version for PowerPoint. The latter isn’t such a big deal, because Excel, Word and PowerPoint share a common library of icons.

With Ken’s gracious permission, I’ve created an updated PowerPoint version of this add-in. This displays all the icons in current versions of Office, and it runs under PowerPoint for Windows and for Mac.

This is version 2. If you downloaded this prior to January 24, 2023, please download and install this improved version. I haven’t created an installer for this, but here are the instructions for manual installation:


PowerPoint Icon Gallery Installation

Download Link

Icon Gallery Add-in Download

Windows Installation

The download is a zip file that holds a single Icon Gallery.ppam file. Expand the zip and copy the .ppam file to your desktop or other easy-to-find location. Here’s how to make it appear in PowerPoint for Windows:

  1. In PowerPoint, choose File>Options>Add-ins.
  2. Change the Manage dropdown to PowerPoint Add-ins, then click on the Go button. The Add-ins dialog opens.
  3. Click on the Add New button. Navigate to the location where you saved the .ppam file, select it and click on OK. The Add-ins dialog should look like this, displaying the add-in name with a check mark beside it:
    Windows Add-in Dialog
  4. Click on the Close button.
  5. In PowerPoint, select the View tab. At the right end, you should see a new group called Office Icons:
    Office Icon group

macOS Installation

  1. In PowerPoint, choose Tools>PowerPoint Add-ins from the macOS menu bar. The Add-ins dialog opens.
  2. Click on the Plus (+) sign. Navigate to the location where you saved the .ppam file, select it and click on OK.
  3. PowerPoint will pop up a macro warning. Click on the Enable Macros button.
  4. Then PowerPoint will pop up this dialog, astoundingly badly worded, even for Microsoft:
    Turn Off Macro Virus Protection
    It sounds like you’re turning off macro protection completely, right? Well you’re not. This just turns it off for this file, and it has no effect on the macro virus protection settings, so there’s nothing to even turn on again! Click on Turn Off.
  5. The Add-ins dialog should look like this, displaying the add-in name with a check mark beside it:
    Icon Gallery Add-in
  6. Click on the OK button.
  7. In PowerPoint, select the View tab. At the right end, you should see a new group called Office Icons:
    Icon Gallery on View tab

Using the PowerPoint Icon Gallery

Windows Useage

Click on one of the galleries to see a group of icons. Here are the first 256:
Gallery 1 Icons

Hover over an icon to see its idMso command name.

Click on an icon to open a dialog that shows the command name for use with idMso or imageMso commands. Click on the Copy to Clipboard button to copy the command name. Then paste the name into your XML or other code. Due to a bug in File Explorer, all Explorer windows must be closed for this to work as expected.

macOS Useage

Click on one of the galleries to see a group of icons:
Icon Gallery - Mac
Note the grey spinning icons: Those are objects that exist in the Windows version, but not in macOS. One of the drawbacks of trying to develop for both platforms is that Microsoft has only done half the job in Office for Mac. Avoid these icons for cross-platform macros.

Hover over an icon to see its idMso command name.

Click on an icon to open a dialog that shows the command name for use with idMso or imageMso commands. Click on the Copy to Clipboard button to copy the command name. Then paste the name into your XML or other code.


Uninstalling the PowerPoint Icon Gallery

Windows Uninstall

  1. In PowerPoint, choose File>Options>Add-ins.
  2. Change the Manage dropdown to PowerPoint Add-ins, then click on Go.
  3. Select the add-in, then click on the Remove button. Close the dialog. The icon gallery disappears from the View tab.

macOS Uninstall

  1. In PowerPoint, choose Tools>PowerPoint Add-ins (on the macOS menu bar).
  2. Select the add-in, then click on the Minus sign (-). Close the dialog. The icon gallery disappears from the View tab.

Notes

Wouldn’t it make more sense to have this on the Developer tab? Well, yes, it would, that’s where the Icon Gallery appears in Ken Puls’ original add-in. But I made one file to work on both Windows and macOS. PowerPoint for macOS is missing the Developer tab. So I put this on the View tab as a second-best location.

Why no icon preview, as in Ken’s original add-in? Previewing icons in VBA relies on the CommandBars.GetImageMso command. This has been deprecated and in recent versions of Office, does not deliver an accurate icon preview. The command is not available at all on Macs, so I removed the preview. But you can see the 32 x 32 version of the icon in the gallery dropdown, not much has been lost.