The Flat Theme – Best Practices

Flat Theme Shape Styles

I’m writing an article or two about Office Effects Themes and how you can modify them. As an example, I created the Brandwares Flat Theme, which will be of use to designers as is. This theme file gets rid of the bulgy 3-D shapes, glows and hokey shadows of the standard Microsoft themes and relies only on tints, shades and outline variations. You can use this example in 2 ways: as a theme file that you can modify and send as your own, and as an Effects Theme file that can be installed in Office for Windows to provide access to flat shapes in all other themes.

Here you can download the Flat Theme. It’s also available on our Downloads page. After downloading, you can open it in PowerPoint, create new font and color themes, apply them, then resave as a new theme. The flat shapes will travel with the theme and be automatically applied to any deck that uses the theme. If you’re an Office for Mac user, you’ll have to create a font theme using this article: XML Hacking: Font Themes.


The Flat Theme – Specs

There are 7 variants in each row of the the Shape Styles dialog, each showing the dk1 color as a background plus the 6 Accent colors. The first 2 rows feature a 0.5pt outline on the shape in a darker variant of the accent color, with the first row showing a white shape background and the second row the relevant accent color.

The third row is the one I choose most of the time: a flat shape with no outline.

The fourth row has a 50% screened-back background color with black text.

The fills for the 5th and 6th rows are 2 progressively darker shades of the accent colors. The 5th row shows a 50% shade of the color, while the 6th is a two-layer multiplier fill with a 50% shade overlaying a 50% tint. I’ve written at length about effects themes and their construction in my book about OOXML Hacking.

Users of Office 2016 for Windows and for Mac will see an additional group of Presets below the theme shape styles. Except for the stroke weight in row 2, these fills are generated automatically by the program and cannot be modified by XML.


The Flat Theme – Installing as Effects Theme

You can also use the Flat Theme as a new effects theme in Windows versions of Excel, PowerPoint or Word (Office for Mac will display effects themes embedded in a theme or template, but there is no support in the program interface for applying a different effects theme). Then it will appear in the Theme Effects dropdown of Office for Windows along with the standard Microsoft themes. Here are the steps to do that:

  1. Download the Flat Theme from the link above and unzip it.
  2. Change the file name from BrandwaresFlatShapes.thmx to Flat.eftx. The first part of the name can be something other than Flat, but the ending must be .eftx. No other change to the theme file is needed.
  3. Close all Office programs.
  4. Copy the file to the same folder as the Microsoft Theme Effects files:

32-bit Office 2007: C:\Program Files (x86)\Microsoft Office\Document Themes 12\Theme Effects

64-bit Office 2007: C:\Program Files\Microsoft Office\Document Themes 12\Theme Effects

32-bit Office 2010: C:\Program Files (x86)\Microsoft Office\Document Themes 14\Theme Effects

64-bit Office 2010: C:\Program Files\Microsoft Office\Document Themes 14\Theme Effects

32-bit Office 2013: C:\Program Files (x86)\Microsoft Office\root\Document Themes 15\Theme Effects

64-bit Office 2013: C:\Program Files\Microsoft Office\root\Document Themes 15\Theme Effects

32-bit Office 2016, 2019, 2021 and Microsoft 365: C:\Program Files (x86)\Microsoft Office\root\Document Themes 16\Theme Effects

64-bit Office 2016, 2019, 2021 and Microsoft 365: C:\Program Files\Microsoft Office\root\Document Themes 16\Theme Effects

With Office 2013 and 2016, there may not be a root folder, but then the Document Themes folder will be inside Microsoft Office, eliminating one level.

Restart an Office program and you’ll see a new addition to the Effects dropdown:

Using the Brandwares Flat Shapes theme as an Effects Theme
Flat Theme Chosen

Please note, repairing Office in Windows will normally delete all non-Microsoft effects themes, so re-installation will be necessary.

Great Color Themes – Best Practices

Great color themes in Office are not a random collection of swatches. Each spot in a color theme has a job. Once you learn those functions, great color themes will roll out from your office.

I’m always astounded to hear a Office “professional” who says “I don’t use themes.” I’m amazed because in modern versions of Office it’s impossible to not to use themes. If you haven’t set a theme for your template, then you’re using the default Office theme. Whether you like it or not! Themes are an integral part of Office, so you’d better learn how they work.

I’ve previously covered Font Themes and how to hack them, a necessary skill for macOS creators. Check out XML Hacking: Font Themes and XML Hacking: Font Themes Complete. In this post, I’m covering the inner workings of theming to show you how to create great color themes. I’ve touched on this subject previously in Office Charts: 6 Colors Maximum! For ideas on how to include more than one color theme in a template or presentation, please see XML Hacking: Color Themes


Great Color Themes: The Basics

When you create a color theme in PowerPoint, the color set is added to the theme1.xml file in your presentation and it’s saved on your computer. If you create a second color theme, that theme is also saved to your computer, but it replaces the first one in your deck. When you’re using the user interface, each Slide Master has only 1 theme at a time. So for more color themes, create more slide masters. If the color theme is for a special purpose, like differently-colored charts, the extra slide master might have only 1 slide layout. That’s less confusing for users.


Great Color Themes: Color Slot Functions

Almost every slot in a color theme has a PowerPoint function, a job that it fulfills for the program. If you don’t know what these are, you’ll place the wrong color in the slot and get a result that looks weird in the program interface. Needless to say, this doesn’t help your professional cred with your client.

Here’s the Color Theme editing dialog as seen in PowerPoint 2016 for Mac. In Office for Mac, you can only create color themes in PowerPoint. In Windows versions, you can create them in any Office program, though there is a good reason why you should still use PowerPoint.

Color Theme Editor

The following advice covers standard presentations that have a light background and dark text. If you’re going for the mysterious Mafioso look with a dark background, then reverse the following instructions putting text colors into the light slots and backgrounds into the dark ones. Oddly enough, when PowerPoint imports a theme exported from Word for Excel, it will default to the Mafioso look. This is the good reason why you should always export theme files from PowerPoint, where your choices for background and text are explicit and that information is preserved in the theme.

The first 4 colors are for text and backgrounds. Although all 4 are called Text/Background, that just to accommodate the occasionally light text on a dark ground, as mentioned in the previous paragraph. In reality, Dark 1 is the main text color. If you have black text in the deck, leave this set at black. You should only change this if you have no black text (Please dont’t tell me you’re doing that trendy look of black text that’s dark grey and makes it look like your printer ran out of toner. Eww.)

You may have a secondary text color for headings. That must go in the Dark 2 slot. Not in Light 1! Not in Light 2! All text colors go in the dark slots!

Light 1 is for background colors. Most of the time, this is white, so leave Light 1 set at white. If the design calls for a different background color than white, set it here.

Light 2 is the only slot in the theme that doesn’t have a secondary job. You can make this slot any color! It doesn’t matter! Woo-hoo! Let’s hold off, this is a good spot for an extra color that doesn’t fit elsewhere.

Accent 1 is the default color for inserted SmartArt, Text Boxes and Shapes. Almost all the time, you will make Accent 1 the primary corporate color. For our company, PMS 481C is the code color, so Accent 1 is the RGB equivalent in all our company themes.

If the company has a secondary brand color, Accent 2 is the logical position for it. So what about Accents 3 to 6? You’re thinking “Hey! 4 empty slots! Throw some colors in, we’re done!” Not so fast, junior.


Great Color Themes: Chart Fills

The set of Accent colors have a huge responsibility of their own: chart fills! I’ve created a color sequence to show how these are applied by PowerPoint.

Office programs fill charts using these 6 six colors in sequence. So when you’re designing, it’s best to know what that sequence is. The colors will be used in the same order:

Left to Right for Column Charts
Great Color Themes - Column Chart
Bottom to Top for Bar Charts
Great Color Themes - Bar Chart
First to Last for Line Charts
Great Color Themes - Line Chart
From 0 degrees (top dead center) clockwise for Pie Charts
Great Color Themes - Pie Chart

If there are no additional colors in the design standards, we create a pair of lighter and darker variations of the brand colors for Accents 3 to 6. But don’t just create a pretty series of swatches! Is the chart readable when printed on a black and white laser? Can color-blind people read it? You’re a Designer! You’re supposed to be thinking of these things! The rule of thumb is to alternate darker and lighter colors in a sequence so they can be distinguished from one another even in monochrome. Not sure? Test it!

Of the 12 colors in the theme, only the first 10 are accessible to the user in color picker dialogs. The last 2, Hyperlink and Visited Hyperlink, are applied automatically when the user inserts a hyperlink in the document. I usually use 2 of the theme colors for these, rather than Microsoft’s standard colors. If there’s a blue, that’s a good choice for the hyperlink, it’s a visual cue. The followed hyperlink can be a lighter grey or other tint, if there is one in the palette.


Great Color Themes: Recognizing Trouble

Before shipping the deck, here are a few quick tests you should be performing to show any color theme problems:

Insert SmartArt: Is the text readable?
Smart Art Problem
Insert a chart: Does the preview look right?
Chart Preview Problem

If either of these look odd, you probably have a color theme problem. If the text or background of either the chart preview or SmartArt don’t match the background of the deck, you’ve probably inserted a dark color into the Light1 slot

Insert a table: Do the auto-generated variations contain many useless combinations?
Table Colors Problem

Most of the autogenerated table combinations in this example are hideous and unworkable, sure sign of a bad color theme. You may also see a table style preview that looks different from the actual table. If the table preview shows a different color for table text (it will just show colored lines, not actual text), then the colors in Light2 and Dark2 have to be switched. Another problem indicator is if it appears you are selecting one color in the picker, but the actual color applied is different.

Insert a chart in Excel: Does the chart background match the worksheet background?
Excel Insert Chart Problem

If you see any of the above symptoms, take the time to fix them and do it right. Your client will notice these glitches and you won’t be able to ‘splain them away.

The general method to fix these issues is to put the theme in correct order, then go through the entire deck starting with the Slide Masters, correcting the colors back to the designed appearance. This effort isn’t too bad if it’s a single template or theme you’re correcting. Groups of finished presentations are a different matter that need a more automated approach. Next time, I’ll be writing about how to repair presentations with a bad color theme, using XML Hacking.

Choosing Fonts for Office – Best Practices

When you choose fonts for Office, it takes a different approach than selecting typefaces for an InDesign document. One obvious difference is that you only need to install the font for a design document on the computer where it’s being created. Using the same font in an Office program will require the font to be installed on every computer using the document. Clearly, this is a much more costly solution. Aside from that, let’s look at the pitfalls of choosing fonts for Office templates.


Choosing Fonts for Office – Fake News

Most of what you see on the internet comparing font formats is wrong. Almost all modern professional fonts are OpenType format. There is PostScript-flavor OpenType, favored by Adobe and ending with .OTF And there is TrueType-flavor OpenType, Microsoft’s choice, ending with .TTF. It’s the continued use of the .TTF file ending that has misled many into thinking that they’re old-fashioned TrueType fonts. They’re not.

To verify this in macOS, open FontBook and examine a font with a .TTF ending. Make sure choose View>Show Font Info. Now look at the Kind parameter. Old-fashioned TrueType fonts would say TrueType here, but more likely you’re seeing OpenType TrueType.

In Windows, if you right-click on any file ending in .TTF and choose Properties, Type of file is reported as TrueType font file (.TTF). But this is illustrative of Windows’ relatively brain-dead design rather than any real information about the font.

Confirming this in Windows requires a few more steps. Start by opening the C:\Windows\Fonts folder. Set the View menu to Details. Now right-click in the row that displays the categories like Name, Font Style, etc. A list of avilable categories display. Choose Font Type. Now you can see that almost all the fonts are OpenType. You’ll only see TrueType if you’ve installed some old fonts from the 90s.


Choosing Fonts for Office – Designer Vanity

Designers from different geographic areas spec fonts differently. As one example, Toronto designers tend to focus on the practicalities of electronic document distribution. As a result, they will often choose Arial or Times New Roman for the user-filled portion of a template. By contrast, designers from New York focus on creating a distinct visual appearance. They choose unusual designer fonts. This creates logistical problems for their clients. They must spend money licensing for all workstations and then take time to install the fonts for each user.

Test fonts from small foundries to licensing a lot of copies. I’ve written about this issue before: Cross-platform Fonts from Small Foundries: Beware! In a mixed Windows/OS X environment, a poor quality font will not display correctly in documents that move between Mac and PC. One typical symptom is Italic text that displays as Roman or Bold when viewed on a different OS, or some similar weight/style mixup.


Choosing Fonts for Office – Collaboration

If the client uses Office documents for collaboration (Don’t know? You should be asking these questions!), you should seriously reconsider a “designer-y” font choice. When the documents arrive at your client’s client, that computer will not have the fonts and the document appearance will change drastically. Unlike web pages, Office documents do not have a font fallback setting. There is no practical way to preset which font will be substituted when the original is missing.

I know what you’re going to say next: “What about if we embed the fonts?” Here are several reasons why that might not work.

  • Embedding does not work at all in Office 2011 or earlier for Mac. Users of these versions can neither embed fonts, nor can they view fonts that have been embedded in Windows.
  • Embedding doesn’t work in Word or Excel for Mac, in both the 2016 and 2019 versions. PowerPoint 2016 for Mac users must have at least version 16.11 to view embedded fonts. The 2016 retail version (as opposed to the Office 365 subscriber version) cannot embed fonts in PowerPoint. Mac users must have at least Office 2019 retail or Office 365 version 16.17 to save embedded fonts in a PowerPoint file.
  • Many typefaces have restrictive embedding permissions. So even if you can embed the font and your client can see it, they will not be able to edit the document using the embedded font. You can get around this if you contact the foundry and request a version with Editable or Installable permissions. Expect to pay a surcharge for this. Some foundries charge a lot for this service, because they’re concerned about losing sales to possible piracy.

Choosing Fonts for Office – Font Families

Designers are used to Single versions of fonts. The is where each font variant appears as a separate entry in the font list in Office. If you want to change to bold or italic, you select a different font from the list. Office doesn’t usually work this way and Office users are not used to this method.

When all four faces in a font family are installed, using the bold and italic buttons has the intended effect of switching fonts.
Choosing Fonts for Office - Font Family Installed

Instead, Office users are familiar with Family fonts. This is where where a group of (usually 4) fonts is linked. To get bold or Italic variants, they click on the Bold or Italic buttons, leaving the font name the same. The foundry usually creates the font families, though there are some type utilities available that let you make a family out of single fonts. As I mentioned earlier, Microsoft hasn’t figured out how to consistently display an .OTF font family correctly. Symptoms vary but are along the lines of you choose Bold and you get Bold Italic, or a similar variant. The wrong font is shown and printed. Typocially this will manifest when moving a Windows-created document to macOS or vice versa.

If the font is not set up as a family-style font, then using the bold and italic buttons fakes the look with stroking and/or slanting the roman. The result is a disastrous visual effect.
Choosing Fonts for Office - Base Font Installed

In macOS, it’s not obvious when you are using single versus family fonts. MacOS creates family groupings on the fly. In Windows, it’s easy: install the fonts, then look at the font menu in an Office program. A font family will only have one entry for the family, while singles will list every font variant. In this screen shot, the Arials are families. Arnhem and ATC Arquette are collections of single fonts:

The Arials are families, while Arnhem and ATC Arquette are singles.
Choosing Fonts for Office - Windows Font Menu

The logical conclusion to the font family approach is that your client should almost never be licensing just one or two typefaces. If four family members are not installed, Office will fake them by stroking the font for bold and slanting it for italic. As you might guess, this looks ghastly and completely off-brand.

The exceptions to this rule are:

  • If the document is a fillable form in Word or Excel. Those documents are typically locked so the user can’t change the font or its attributes.
  • The the font is used only for Headings. These are usually bold and stay that way, so there is less chance of a user applying attributes.

In either of these 2 situations, you should be able to get away with licensing a single typeface instead of a complete family.

A font family with all 4 members installed. The bold and italic button work as expected.
Choosing Fonts for Office - A font family
Here is a family-style font with only the Roman installed. Using the bold or italic buttons gets you this dreadful look, plus an out-of-memory warning from Office.
Choosing Fonts for Office - Roman only installed

If your design calls for an unusual mix of weights, like Light and Demibold instead of Regular and Bold, contact the foundry to request a custom family. There is normally a small charge for this service. However, if the licensing deal is large enough, the foundry may waive this.


Choosing Fonts for Office – 2 Solutions

To sum up, for each different font used in your design, your client should be licensing a complete family of 4 typefaces in TrueType or Truetype-flavored OpenType.

Brandwares is a font reseller and we’ve been speccing type for Office for years. If you choose us to create your templates, we can also source your client fonts in the correct format and family. This service includes free tech support. We’ll help your client with any installation or usage issues and communicate with the foundry, if necessary.

Working on your own? A simple way to eliminate all these issues is to design with the fonts that are already installed by Office. There are many faces more interesting than Arial and Times New Roman in this collection. The fonts that come with Office don’t require any additional licensing fee. They are already installed and they have relaxed embedding permissions to make collaboration easy. They are all high-quality typefaces licensed from major foundries like Monotype. Here is a list of the families that are useful for business communications (we left out Comic Sans!). For maximum compatibility among all versions of Office, use a font that is checked in every column.

Click to view larger image
Useful Office Fonts

This list is available as a free PDF that shows character listings for every font by clicking on the font name. Email me to get a copy: production@brandwares.com

Best Quality Logos for Office – Best Practices

It’s a challenge to create the absolute best quality logos for client files in Microsoft Office. Most artists choose bitmap formats for logos, usually JPEG format. Apparently this is some kind of received wisdom from artist to artist, because JPEG format is close to the worst possible format for logos. But I’ve already covered this subject in JPEG Logos? Fail! back in 2013.

Brandwares has used indexed-color PNG format for most line art (a term for non-photographic art that is mostly flat color areas). Most logos qualify as line art. But there are a couple of disadvantages to using any type of bitmap format for branding information.

With Office files, Microsoft is determined to foist image “compression” on us. I put compression in quotes because Microsoft’s solution is really downsampling by another name. Whatever the name, the results are blurry and absolutely do not reinforce the brand. All bitmap files will be downsampled unless the user chooses only a single file. You can’t protect the company logo, even with XML hacking. Let’s face it, sooner or later, bitmap logos will look like mush.

The other persistent problem with bitmap formats is what happens when you create a PDF from a document. Acrobat’s default settings assume you want to create a small file to post on a web page. This was a serious problem 20 years ago. So, once again, a software company’s helpful authoritarianism leads to default settings that cream the logos in any Office file.


Vector Formats for Best Quality Logos

For many years, we at Brandwares were aware that a vector format was a potential way out of this. Vector formats are naturals for line art, because they easily handle geometric shapes with simple coloring. But there are relatively few vector formats from which to choose, and the available formats didn’t seem up to the job.

One grandaddy of vector formats is the EPS file. Well-known to designers, the EPS doesn’t get great support in Office programs. Printing them at high resolution requires PostScript support from the printer, which is dicey in most business offices. Office programs can’t ungroup them, so adding theme color support in an Office file is out of the question.

CGM was an early contender, and is still used in technical applications. But it never got support in common file formats. SVG is making inroads on the web, but Office is only beginning to support the format.

Let’s be honest, Microsoft offers the best support to the formats it invents. For vector graphics, that is WMF and EMF. WMF is a 16-bit format that was invented in the ’90s. In practice, it’s not too useful today. All too often, WMF files do not render the inside curve of shapes like O or D. In addition, Adobe Illustrator’s WMF export is horrendous, turning every curve into a series of angled straight lines. Corel Draw does a better export, but the format is limited by its 16-bit capacity.

The format we’re left with is EMF (Enhanced MetaFile). Brandwares has developed a method to create the highest quality EMF files possible. Whatever you do, do not use EMFs exported by Adobe Illustrator! Illustrator’s curve accuracy goes down the toilet when it exports as EMF. Here’s what you’ll get, versus the type we produce:

EMF from Adobe Illustrator: wonky curves!
Adobe Illustrator EMF
EMF from Brandwares
Brandwares EMF

We create robust logos with a tiny file size and razor sharpness at any resolution and transparent backgrounds and they will never get downsampled by Office or Acrobat!


Best Quality Logos In Use

Once we’ve placed our EMF logos in your presentation, they can be ungrouped in Windows versions of PowerPoint, then you can key part or all of it to a theme color. If your presentation contains multiple color themes, changing theme colors will change the keyed logo element automatically. This can be a slick trick for presentations with different sections in different code colors. If you’re working with a Mac, let us know and we can ungroup and key the logo parts for you.

Best quality logos in identical slide layouts keyed to different color themes

The layout for these slides is identical. Each uses a different color theme that varies one code color.

Transparency is not supported in most EMF exports, but by importing and ungrouping the logo, you can add transparency back in. In PowerPoint, choose Drawing Tools>Shape Fill>More Fill Colors…, then set the Transparency slider. This works the other way around from Illustrator, but the units are the same. If the Illustrator file used 40% Opacity, set 60% Transparency in PowerPoint.

Best quality logos benefit from EMF transparency

From L to R: each character has 10% more transparency. You can’t get this by adding transparency in Illustrator, you must re-create it in Office.

EMF are not a great candidate for objects like disclaimers. Each letter includes one or 2 complex curves, so a paragraph of text will be much larger that the same disclaimer rendered as an indexed-color PNG or even a JPEG of the same text. But for logos, they’re pretty great. You get the same small file size and pin-sharp appearance regardless of how much you enlarge it. Applying image compression or printing to a low-res PDF leaves EMF logos in pristine condition. It’s by far easiest way to create the best quality logos for Microsoft Office.

OOXML Hacking: Font Themes Complete

I wrote about how to create a basic font theme in 2015: XML Hacking: Font Themes. Thanks to everyone for the comments and feedback that have allowed me to refine the article and make it more helpful.

That article covered a bare bones font theme for European languages (referred to as Latin fonts in Microsoft-speak). International and multilingual users require a theme that can work with a greater variety of languages and fonts, so in this article I’m going to cover how these work and how to create them.


A More Complete Simple Theme

There’s more we can do with the very basic theme from the previous article. In the listing below, a font has been specced for only Latin fonts. Important Note: If you copy and paste these samples, you must change the non-breaking space characters to ordinary spaces. I need to use non-breaking spaces to format an HTML page, but Office will refuse to display your font theme if you don’t search and replace them with regular spaces.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:fontScheme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Test">
  <a:majorFont>
    <a:latin typeface="Arial"/>
    <a:ea typeface=""/>
    <a:cs typeface=""/>
  </a:majorFont>
  <a:minorFont>
    <a:latin typeface="Arial"/>
    <a:ea typeface=""/>
    <a:cs typeface=""/>
  </a:minorFont>
</a:fontScheme>

In both the Major (Headings) and Minor (Body) categories, there are also ea (East Asian) and cs (Complex Scripts) entries. These theme entries are inactive until text is formatted as a relevant language. As long as your text is marked as US English (either by using the Review>Language>Set Proofing Language, or by setting the language in a Style), only the Latin theme fonts will be active. But if you mark text as Chinese, the Office program will check the theme and use the font in the ea tag instead. Likewise, Persian text will activate the cs theme font.

What will not work is to try to set an East Asian or Complex Scripts font in the Latin tag. Depending on the version and platform of Office, you’ll only get European characters showing, or the program will completely ignore your theme. Here’s a simple font theme that will work with Japanese, Arabic and European languages:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:fontScheme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Test">
  <a:majorFont>
    <a:latin typeface="Arial"/>
    <a:ea typeface="Meiryo"/>
    <a:cs typeface="Andalus"/>
  </a:majorFont>
  <a:minorFont>
    <a:latin typeface="Arial"/>
    <a:ea typeface="Meiryo"/>
    <a:cs typeface="Andalus"/>
  </a:minorFont>
</a:fontScheme>

Depending on which ea or cs font you choose, it may support one or several languages. As an example, CJK fonts will support Chinese, Japanese and Korean. Of course, in a collaboration scenario, the fonts chosen should be available on both Mac and Windows, or the display of one of the langauges may get mangled with a font substitution. The best idea is to stick with fonts distributed by Microsoft with Office.


Complex Font Themes

When you crack open the XML on a document or theme, the font theme information is contained in theme/theme1.xml. This illustrates a font theme that is ready to take on the world:

<a:fontScheme name="Office Theme">
  <a:majorFont>
    <a:latin typeface="Calibri Light" panose="020F0302020204030204"/>
    <a:ea typeface=""/>
    <a:cs typeface=""/>
    <a:font script="Jpan" typeface="MS Pゴシック"/>
    <a:font script="Hang" typeface="맑은 고딕"/>
    <a:font script="Hans" typeface="宋体"/>
    <a:font script="Hant" typeface="新細明體"/>
    <a:font script="Arab" typeface="Times New Roman"/>
    <a:font script="Hebr" typeface="Times New Roman"/>
    <a:font script="Thai" typeface="Angsana New"/>
    <a:font script="Ethi" typeface="Nyala"/>
    <a:font script="Beng" typeface="Vrinda"/>
    <a:font script="Gujr" typeface="Shruti"/>
    <a:font script="Khmr" typeface="MoolBoran"/>
    <a:font script="Knda" typeface="Tunga"/>
    <a:font script="Guru" typeface="Raavi"/>
    <a:font script="Cans" typeface="Euphemia"/>
    <a:font script="Cher" typeface="Plantagenet Cherokee"/>
    <a:font script="Yiii" typeface="Microsoft Yi Baiti"/>
    <a:font script="Tibt" typeface="Microsoft Himalaya"/>
    <a:font script="Thaa" typeface="MV Boli"/>
    <a:font script="Deva" typeface="Mangal"/>
    <a:font script="Telu" typeface="Gautami"/>
    <a:font script="Taml" typeface="Latha"/>
    <a:font script="Syrc" typeface="Estrangelo Edessa"/>
    <a:font script="Orya" typeface="Kalinga"/>
    <a:font script="Mlym" typeface="Kartika"/>
    <a:font script="Laoo" typeface="DokChampa"/>
    <a:font script="Sinh" typeface="Iskoola Pota"/>
    <a:font script="Mong" typeface="Mongolian Baiti"/>
    <a:font script="Viet" typeface="Times New Roman"/>
    <a:font script="Uigh" typeface="Microsoft Uighur"/>
    <a:font script="Geor" typeface="Sylfaen"/>
  </a:majorFont>
</a:fontScheme>

For brevity, I’ve omitted the Minor font section. Instead of setting the ea and cs fonts, this font theme has entries for more tightly defined language groups and different fonts assigned to each one. This level of detail is necessary for a font theme that can be used around the world. Since I copied this listing from theme1.xml, it doesn’t have the XML opening that a standalone font theme would have.

For a complete list of all 4-letter script/language codes, search online for ISO 15924 Code Lists.

Setting up and testing a complex font theme like this is not a simple task. The font switching is automatic and is triggered by the language input setting on your computer, the language set in your template styles and the language set in the text being edited. Please post your comments, let me know of any hiccups or problems you notice and I’ll try to answer your questions.

Brandwares creates font themes to help global corporations support every language. Send me a message for ensure your files have worldwide useability: production@brandwares.com

OOXML Hacking: Custom Picture Content Controls

Recently I was creating a white paper template in Word for a client and needed to insert some custom Picture Content Controls for photos that would be inserted by users. The designer had specced round-cornered pictures, but Picture Content Controls (PCC) have square corners. It didn’t take long to figure out that after selecting the PCC, I could choose the Picture Tools>Format tab of the Ribbon, then apply a Picture Style. I chose the rounded corners with reflection (fifth icon over in Word 2010), then removed the reflection.

Now I had rounded corners, but also another problem. Word keeps the corner radius in proportion to the box size, so resizing the PCC up to the right size made the radius much larger than the design. Unlike AutoShapes, Content Controls will not display a yellow radius handle to adjust the radius. I also tried resizing the PCC before applying the Picture Style, but got the same big corners.

Default Picture Content Control

A Picture Content Control with default corner radius.


Custom Picture Content Controls XML

When I’m stuck, I crack open the XML. Can’t leave it alone! If you’ve never opened Office files to edit their XML, read XML Hacking: An Introduction. If you’re using a Mac, you should also read XML Hacking: Editing in OS X. All document content is in word\document.xml, so I opened it and started searching. In some respects, a PCC is handled like an ordinary picture, so I found it inside a <w:drawing> tag. The information I was looking for was in this subsection:

<pic:spPr bwMode="auto">
  <a:xfrm>
    <a:off x="0" y="0"/>
    <a:ext cx="3222172" cy="4576355"/>
  </a:xfrm>
  <a:prstGeom prst="roundRect">
    <a:avLst>
      <a:gd name="adj" fmla="val 8594"/>
    </a:avLst>
  </a:prstGeom>
  <a:solidFill>
    <a:srgbClr val="FFFFFF">
      <a:shade val="85000"/>
    </a:srgbClr>
  </a:solidFill>
  <a:ln>
    <a:noFill/>
  </a:ln>
  <a:effectLst/>
</pic:spPr>

When I spotted the line <a:prstGeom prst=”roundRect”>, I was pretty sure that’s what I was looking for. But inside that tag, there were only 2 parameters. I went for the fmla tag and changed the value from “val 8594” to “val 4000”. Because I’m experimenting, I make only 1 change, then zip the XML to test. If you make several changes and the file doesn’t open, it can take a long time to find the error.

I reopened the Word file. Success! The corner radii were about half the size. Then I just had to try several values until I found one that match the designer’s intent. Keep in mind that the fmla value is not setting any particular radius size, it’s setting the ratio of the curve to the size of the picture. So you should make the placeholders the correct size first, then try out fmla values to get the radius you want at those dimensions.

You don’t always get lucky with parameters. A few lines down I spied another setting that looked like it could be useful. While you can set the PCC border in the program interface, you can’t set the fill color. However, in the XML, I saw these tags:

  <a:solidFill>
    <a:srgbClr val="FFFFFF">
      <a:shade val="85000"/>
    </a:srgbClr>
  </a:solidFill>

Unfortunately, changing these values had no effect on the color of the Content Control. So what do these tags do? Search me, maybe someone at Microsoft knows. But I was happy to be able to set the radii to my preference. Here’s the final result:

Custom Picture Content Controls

A custom Picture Content Control with smaller corner radii.

We can provide custom Content Controls and much, much more. Get pro help with your PowerPoint project by emailing me at production@brandwares.com.

Outline Numbering Variations – Best Practices

In my last post, I translated the classic method of outline numbering for macOS. But Shauna Kelly’s original steps have an element of personal preference them. We can also get reliable results from outline numbering variations.

Unfortunately, Shauna passed away a few years ago. I’m glad her site is still kept running by volunteers. If you’re formatting for Windows, you should read her article first: How to create numbered headings or outline numbering in Word 2007 and Word 2010

I think one notable restriction of Shauna’s procedure is that she relies on the built-in Heading styles. Often a numbering scheme is required that has nothing to do with headings. Here’s how we can separate these concepts and create solid numbering using an arbitrary style set. This applies to both Windows and OS X versions of Word.


Outline Numbering Variation – Alternative Styles

In Shauna’s classic technique, the first step is to revise the built-in Headings 1 to 9 so that Heading 1 is independent of other styles, then all the subsequent headings inherit characteristics from Heading 1. We’ll reuse this basic concept for a different style set.

First create a style that will be the basis for the first level of your outline numbering. For a start, this style should be based on No Style (Word OSX: Format>Style>Modify>Style based on:>(no style) Word for Windows: Ctrl + Alt + Shift + S to open the Styles list>Click on Manage Styles button>Modify>Style based on:>(no style)). This style really only needs to include the font, font size, line spacing, space before and after the paragraph. Any indenting or number style will be handled later. For this article, let’s call it Number Style 1. There is one essential parameter you must set. In the Paragraph format for the style, you must set the Outline level to Level 1 (With the Modify Style dialog still open, click on Format>Paragraph>Outline level. This is the key to making this work!

Next, we’ll create the second style. Start by basing it on Number Style 1, then format whatever variation it might have, staying away from indentation or numbering. Outline numbered styles are often very similar, this style might be exactly the same as Number Style 1. However, in Format>Paragraph, Outline level must be set to Level 2. Are we picking up the pattern yet?

Each additional style in the outline numbered series must be:

  • based on the previous style, and
  • have an outline level that is one level down from the previous style.

As long as you can format a chain of styles following these principles, you should be able to get it to work with the technique on this page for OS X (replace the first section Outline Numbering in Word for OS X – The Classic Method with the procedure on this page) or Windows (replace section 3. Set up your Heading paragraph styles with this page’s technique instead.


Outline Numbering Variation – Nested Bullet Styles

You can create nested sets of bullet styles by following the same steps as above. When the Define new Multilevel list dialog is open, use the dropdown called Number style for this level, scroll all the way down and you’ll find 6 bullet presets and options for choosing a different bullet or a picture bullet. Nested bullet styles work like outline numbering for bullets, though they’re a new concept for most users.

Feel free to post constructive comments suggesting improvements, I’m always trying to make these articles better.

Nested Bullet List Dialog

Outline Numbering in Word for macOS – Best Practices

Unlike most of my articles, this one is not a piece of original research. Shauna Kelly wrote the definitive method for producing outline numbering in Word several years ago. Unlike most of what you’ll read about techniques for creating numbering in Word, Shauna’s procedures actually work reliably. Unfortunately, Ms. Kelly passed away several years ago, though her web site has been kept going by volunteers. You can read her original posts here: How to create numbered headings or outline numbering in Word 2007 and Word 2010. My contribution is to document the steps needed to produce outline numbering in Word for macOS.

The names of some commands are different, or they’re found in a different place. I’m sticking to the step-by-step approach. For an in-depth explanation of why the steps work, please consult Shauna’s original pages. These instructions are quite specific. Please don’t include any steps not on the list below, or you’re on your own for the results.

Shauna argued strongly for using the built-in heading styles Headings 1 through 9. There’s nothing wrong with this and it can save a few steps. Sometimes, however, I prefer to save heading styles for headings and create a separate set of styles for numbering. In this article, I’ll translate Shauna’s classic method. The next post shows some optional variations: Outline Numbering Variations. If this is to be the basis for future documents, you want to be making these changes in a template. If you do this in a document and don’t apply the changes to the source template, you’ll have to redo all these steps for the next document or copy the styles using Word’s Organizer (Tools>Templates and Add-ins>Organizer in Word for Mac). Whenever you copy outline numbered sequences, you need to copy the styles that are linked (Headings 1 to 9 in this example) plus the List style (Numberings in this case).


Outline Numbering in Word for macOS – The Classic Method

Setting up the Styles

  1. Choose Format>Style and select Heading 1. (If you’re not already using Heading 1 in your document, change the List: dropdown to All styles)
  2. Click on the Modify button.
  3. Change the Style based on: dropdown from Normal to (no style) at the top of the list, then click on OK. While the dialog is open, choose Format>Paragraph and set the Left indent to 0 and the Special indent to (none). If there is any indenting, these will be set later. If you had already formatted Heading 1, you may need to make some changes after detaching it from Normal.
  4. Select Heading 2, click on Modify and change Style based on: to Heading 1. OK out.
  5. Repeat step 3 for each built-in Heading style, for as many levels of outline numbering as you require. Each style should be based on the one before.

Opening the Right Dialog Box

  1. In the Paragraph section of the Home tab, choose Multilevel List>Define New List Style. Avoid starting from Numbered List, that is not reliable.
    Multilevel List>Define New List Style in Word 2011 and 2016
    Outline Numbering in Word for OS X - Multilevel List 2011 (left) + 2016 (right)
  2. In the Define New List Style dialog, give your style a plural name like Headings or Numberings, since this will apply to several styles.
  3. Click on the Format button and choose Numbering.
  4. Set the style name and click on Format>Numbering in Word 2011
    Name + Numbering in Word 2011
    Word 2016 for Mac:
    Name + Numbering in Word 2016
  5. Now the Bullets and Numbering dialog opens, an extra step that doesn’t happen in Word for Windows. If you need straightforward legal-style numbering, there is a preset shown in the window that can save you many of the steps in the routine outlined below. Click on the Customize button.
    Bullets and Numbering Customize Button

Link a Paragraph Style to a List Style

  1. Finally we get to the Customize Outline Numbered List dialog. Once this dialog is open, we will leave it open until all levels are set up. Start by clicking on the dialog expander button to see all the options (circled in red):
    Word 2011:
    Customize Outline Numbered List in Word 2011
    Word 2016 for Mac:
    Customize Outline Numbered List in Word 2016
  2. Start by selecting 1 in the Level list.
  3. Next, we attach the paragraph style to the list style. Select Heading 1 in the Link level to style dropdown:
    Word 2011:
    Attach Paragraph Style to List Style in Word 2011
    Word 2016 for Mac:
    Attach Paragraph Style to List Style in Word 2016
  4. Now set the numbering for the style. In the Number format: (Word 2011) or Enter formatting for number: (Word 2016/2019) field, delete any content displayed. If the first outline numbering level starts with text, like Chapter 1 or Section 1, type in the text and a space.
  5. Using the Number style: (Word 2011) or Number style for this level: (Word 2016/2019) dropdown, choose the number appearance. Outline Numbering in Word for OS X has a quirk: the Level 1 choice is already displayed, even if no number appears in the Enter formatting for number: box. Just click on the dropdown and re-select the Level 1 that already appears selected and Word will do the right thing. A number appears in the Number format: or Enter formatting for number: field.
  6. Add any punctuation or symbol that is to follow the number.
  7. Set the Number position and Text position. Both numbers are the distance from the left margin. Left alignment for numbers is most common, but Roman numerals can look better right-aligned, since their width varies more. Normally the tab and indent are set for the same amount. The tab controls the position of the first line and the indent all the lines in the paragraph after that.

Repetition for All Levels (Legal-style Numbering)

Doing the rest of the levels involves repetitive steps that get a little longer with each level. Here are the steps for level 2:

  1. Select 2 from the Level list.
  2. Choose Heading 2 from the Link level to style: dropdown.
  3. Delete the contents of Number Format: (Word 2011) or Enter formatting for number: (Word 2016/2019).
  4. Set Previous level number: (Word 2011) or Include level from: (Word 2016/2019) to Level 1.
  5. Type a period.
  6. Click on the Number style: (Word 2011) or Number style for this level: (Word 2016/2019) dropdown and choose 1,2,3, ….
  7. Set the Number position and Text position.

So far, so good. Now let’s do level 3:

  1. Select 3 from the Level list.
  2. Choose Heading 3 from the Link level to style: dropdown.
  3. Delete the contents of Number Format: or Enter formatting for number:.
  4. Set Previous level number: or Include level from: to Level 1.
  5. Type a period.
  6. Set Previous level number: or Include level from: to Level 2.
  7. Type a period.
  8. Click on the Number style: or Number style for this level: dropdown and choose 1,2,3, ….
  9. Set the Number position and Text position.

Steps for Level 4:

  1. Select 4 from the Level list.
  2. Choose Heading 4 from the Link level to style: dropdown.
  3. Delete the contents of Number Format: or Enter formatting for number:.
  4. Set Previous level number: or Include level from: to Level 1.
  5. Type a period.
  6. Set Previous level number: or Include level from: to Level 2.
  7. Type a period.
  8. Set Previous level number: or Include level from: to Level 3.
  9. Type a period.
  10. Click on the Number style: or Number style for this level: dropdown and choose 1,2,3, ….
  11. Set the Number position and Text position.

Are you seeing the pattern? Each additional level repeats the previous steps and adds 2 new steps. By the time you get to level 9, you’ll have set the previous level and typed a period 8 times before setting the last number!


Editing Outline Numbering in Word for OS X

Like every good designer, you’ll probably want to tweak these styles later. For paragraph styling, like the amount of space before or after, you can simply modify the paragraph parameters. That’s easy. But anything to do with the numbering or its positioning relative to the paragraph should be done in the Outline Numbering dialog. Unfortunately, both Word 2011 and 2016 have a completely non-intuitive method for getting a list style into editing mode.

  1. In the Quick Style Gallery, right-click on Heading 1 and choose Modify Style.
  2. Click on the Format button and choose Numbering. The Bullets and Numbering dialog opens to the List Styles tab, where you can’t Add, Modify or Delete anything: the buttons are permanently disabled. Serious bug!
    Word bug: the Plus, Minus and Modify buttons are permanently disabled.
    Outline Numbering in Word for macOS - Ineditable List Style
  3. Click on the Outline Numbered tab. None is highlighted, which is not helpful. Examine the tiles carefully, you have to choose the correct one. Since you have linked styles to levels, the tile you are looking for will show the first 3 of those style names, but then several other tiles will also show the heading names as well.
  4. Click on it the most likely suspect and see if the Reset button becomes enabled. That only happens with user-created list styles, so that’s an indication of the correct tile.
  5. Now click on the Customize button. This will only work if you are editing the outline numbering on the same installation of Word on which you originally created it. Open in a different installation or version and the Bullets and Numbering tiles do not show your custom list.
  6. Edit the numbering, then exit when you are finished. Instead of editing your named List Style, Word has created a new list style autonamed Current List1.

If you’re using a different installation of the program than what you created the list on, you can’t even use the Outline Numbered tab. All the tiles will display the stock numberings. Instead of editing your list style, you must start all over and get it right in one editing pass.


Outline Numbering in Word for OS X: The Customize Outline Numbered list Dialog

Here are the final results for an outline numbered style as created in Word 2011. These shots are from the same dialog, only the Level number has been changed.

Level 1 in 2011
Level 2 in 2011
Level 3 in 2011
Level 4 in 2011
Level 5 in 2011
Level 6 in 2011
Level 7 in 2011
Level 8 in 2011
Level 9 in 2011

You can use Brandwares’ expertise to set up your outline numbering. Contact me at production@brandwares.com for an estimate.

5 Word Formatting Mistakes – Best Practices

Word is found everywhere, but Word users with training are a scarce commodity. It’s a shame, because a little training can go a long way to get really nice results. This article will cover the most common formatting mistakes that Word users make. If you’re a designer, you could still benefit, I see plenty of these errors from design companies as well.


Formatting Mistake #1: Not making the Non-printing Characters Visible

Pretty View, formatting mistakes paradise

Pretty View

By default Word is set up to show “pretty” documents. Microsoft has decided that users want to see what the printed output will look like on-screen. So Word hides all the control characters that are vital for reliable formatting. Users can’t see the hidden formatting that they are inserting or deleting. Result: formatting mistakes! The only way you can provide professional documents for clients is by making these visible so you can deal with them. When you want to see the printed result, do a Print Preview. It’s fast and more accurate than the “pretty” screen display.

Useful View, showing formatting characters

Useful View

The exact steps for show the control characters is slightly different for each version of Word, so I’m not going to list them all here. To start in OS X, look for Word>Preferences>View, in Windows, choose File>Options>Display. Make all the non-printing or formatting characters visible. It’s also helpful to display Bookmarks, Object anchors and in Word 2010/2011 or earlier, Text Boundaries. In Windows, these last three are found on the Advanced tab of Options.

Now you can see Paragraph Marks, which hold the paragraph formatting for the text that precedes it. You can see the Section Breaks that hold all the header/footer, margins and page orientation information for the paragraphs preceding it. And you can see the Anchors for text boxes and floating pictures, which makes it much easier to anchor to a paragraph that is likely to stay on the same page.


Formatting Mistake #2: Creating New Pages with Multiple Carriage Returns

This is the classic hallmark of the Word user who has never taken a course or cracked a book. At the end of a topic, they’ll type enough carriage returns to get to the next page, then type a new heading. It looks perfectly fine on the original computer:

How it looks on your computer

How it looks on your computer.

But then it’s sent to a different computer with different fonts or a different printer. The heading that supposed to be at the top of a page either moves to the bottom of the preceding page, or moves down so it’s not at the top of the page anymore. It doesn’t matter much which one happens, because the formatting mistakes scream Amateur Hour:

Your formatting mistakes are clear to everyone but you.

How it looks on a different computer.

Text flow in Word depends heavily on the font being used and the printer that has been selected. If you move the document to a different computer, they might not have the same font. Even a change in the version of a font is enough to make the text break differently. As for the printer, Word fabricates pages on the fly by using the metrics of the selected printer. These metrics come from the printer driver. So if the user who receives the documents has a different printer, or even a different driver for the same printer, the pages will be laid out differently.

The knowledgeable Word worker will insert a Page Break (not a Section Break) at the end of a text block to create a new page:

Page break: How it looks on every computer.

Page break: How it looks on every computer.

A really clever user will create a heading style that includes the paragraph attribute Page break before, so that whenever the heading style is applied to text, it automatically pops to the top of a new page:

Heading Style using Page Break Before Setting

Heading Style using Page Break Before Setting


Formatting Mistake #3: Using Tabs to Arrange Data in a Grid or Table

Whenever you need to arrange comparative information in rows and columns, you’re creating tabular arrangement. It’s always a good idea to pause for a moment and really look at the kind of data you want to present, so that you can choose the best format for that. If you find yourself using tabs and spaces to create a grid of data, STOP.

Making formatting mistakes with tabs

Making a lame table with tabs and spaces.

Information in a grid is tabular data (from which the tab key takes its name), but tabular data should go in a table. That’s what they’re for! Tab keys are left over from typewriters, when there was no other way to create a data grid. Designers are also guilty of creating grids with tabs, because table tools are relative newcomers to page layout software.

Use a table to arrange tabular information.

Use a table to arrange tabular information.

Tables are also the only professional way to make forms, which brings us to our next common mistake:


Formatting Mistake #4: Using Typewriter Techniques to Make Forms

Word, especially Windows versions, is loaded with excellent form-creation tools. But you’d never know it from the forms I almost invariably see created in that program. The common approach is to type a text heading, then dozens of underscores to indicate where the form-filler is to enter their data. This could pass for forms that are printed out and filled with a a pencil. You know, like people used to do 50 years ago:

Typewriter-style Form, serious formatting mistakes

Typewriter-style Form

Open the Word “form” on your computer and try filling it in. As you type, the underscores remain, trailing after your text. Type a couple of line of text: the left side of the filled portion falls underneath the heading, not to its right. The professional term for this is “a dog’s breakfast”.

Formatting mistakes: The form falls apart when filled.

The form falls apart when filled.

For forms that are filled on a computer, you need a much more robust method. Create a table with a cell for the heading and a separate cell for the filled-in area. If the form will only be filled out on the computer, you don’t need any horizontal rules to guide your text. The computer does that for you. If the form is intended to be dual purpose computer or hand-filled, add a thin border to the bottom of the filled-in cell. No other border are necessary or desirable. All of a sudden you have a form that is neat before and after filling, easy to read, even, dare we say, good-looking!

Table Form

The right way to make a form: with a table.

Here’s a comparison of a table form and a typewriter-style form when filled with longer text:

Form Comparison - Spot the formatting mistakes

Inserting long text


Formatting Mistake #5: Local Formatting Instead of Styles

Another giveaway of the Word amateur is when you click on different types of text and heading, but the Style always says Normal. This means the creator of the document made no use of Styles. Perhaps they think they are saving time, but the opposite is true. Repurposing or updating an unstyled document takes almost as long as creating it in the first place. Plus, useful Word features like a Table of Contents or the Navigation Pane don’t work well without using styles.

Local formatting mistakes

Using local formatting to imitate true styles.

After taking just a few minutes to create some basic styles everything about document creation and revisions is much faster. Styles are a true productivity booster. If you’re not using them, either you are wasting a lot of time, or you’re making someone else fritter away hours of their work day. Styles ensure your documents have a consistent, professional appearance. Updating their appearance in the future takes only a few minutes. It’s what the pros do!

Styled Text: formatting mistakes avoided!

A Heading Style applied.

We’re Word professionals! Brandwares will create technically perfect templates and documents for your company. For bullet-proof files, contact me at production@brandwares.com.

OOXML Hacking: Document Repair

You have a crucial thesis or presentation that’s due in the morning, but when you try to open it, you get a message saying the file has an error. It may seem like the end of the road, but with a little XML hacking, you can repair your file in just a few minutes and be back to work. Document repair is something you can do yourself.

First, let’s look at different causes of file corruption. The number one cause is working on files while they are on temporary or removable media. A USB or flash drive is a convenient way to carry data. The common alternative is to keep your information in the Cloud. But both of these are hazardous if you’re editing files. Accidentally ejecting a USB stick or losing your Internet connection while a file is open in Office is a near-guarantee of corruption. This type of corruption is also disastrous, because the file contents are so thoroughly scrambled, there is no way to recover the data.

But there are also files that get scrambled by software and usually these are recoverable. We’ll use the same techniques covered in previous posts. Windows users should review XML Hacking: An Introduction, while OS X hackers need to follow these instructions: XML Hacking: Editing in OS X


Is the File Recoverable?

When opened in Office, unrecoverable files may give you errors like these:

Recover Text
Parts Missing

The first step is to rename a copy of the file with a .zip ending and expand it. An unrecoverable file (one scrambled by a USB or Cloud drive) will almost always raise an Zip error. Cut your losses, you’re not going to be able to fix this. As a second-best alternative, try opening the original damaged file in NotePad (on Windows) or Text Edit (OS X) to recover whatever text you can. You also might be able to extract some contents by opening in a different word processor, like Pages on a Mac.

By contrast, if you see the following messages, document repair is possible:

Illegal Character
XML Corruption Warning

You can see that the first 2 messages are generic, while the second 2 give a specific location for the error. This means the file is at least partially readable by the program.


Error-finding

There are quite a few document repair articles on the web that are worth reading for the variety of tools that people are using. I prefer a combination of a good text editor (NotePad++ on Windows, BBEdit on OS X), plus a modern browser like FireFox or Chrome. The text editor is where you do the editing, while the browser parses the XML and finds any errors.

You’ve already unzipped the document or presentation, now look for the XML portion that contains the error. Most of the time, with a Word file, document.xml will be the culprit. Open document.xml in the text editor and Prettify (NotePad++) or Tidy (BBEdit) it to make it readable. A raw document.xml file only has 2 lines, which is why the XML errors are invariably reported as being on line 2. Making the text readable also adds useful line numbers to error reports, making the errors much quicker to find. Now the file should look like this:

document.xml

Save document.xml, then open it in your choice of browser. This is how FireFox and Chrome show where the first error is:

Browsers View XML

As you can see, the report is a little more informative in FireFox. The error is a mismatched tag: a tag was opened but not closed. It expected to see the closing tag </mc:Fallback> and it tells you exactly where it thought that tag should be. The arrow points to the first character that is in error. The correct way to interpret this is that the expected end tag should be inserted immediately before the tag pointed to.


Document Repair Technique

Here’s what the error location looks like in the text editor:

Document Repair Error Location

Then here is what it looks like after inserting the closing tag (you can copy and paste directly from the browser window):

Step 1 Document Repair

Save document.xml in the text editor, then refresh the browser. The next error is shown:

Step 1 Result

Repeat the steps. Some files have only a couple of errors, others may have dozens. You’ll know when you’re done, because refreshing the browser will give you a different screen, displaying the XML instead of an error message:

Final Document Repair Result


Rebuild the File

Close the text editor and browser, then re-zip the folders and [Content_Types].xml, giving the zip file a new name and a file ending that matches the original. Open it to ensure it works. Office does not tolerate XML errors well and doesn’t give you clear error messages, so if the file doesn’t open, you missed something. In addition, Mac users have to use Terminal to zip and view files, as noted on the XML Hacking: Editing in OS X page.

Lots of people ask “How can I prevent this?”, but there isn’t a really good answer. If a file can be repaired, it’s almost always due to a program bug that writes malformed XML. In the Word file used for example, this is often when a placed graphic has no fallback information, which is supposed to help with graphic depiction in older file formats. It appears that the program omits the closing fallback tags when saving and you get the error. It’s not your fault, but Microsoft has not been able to find and eliminate this bug since the 2007 version.