Archives for November 2016

[Video] Dishing on Presentations and Webinars with expert, James Hilliard

Get a preview of what we will be sharing with you in our December 1st webinar with James Hilliard, a professional moderator and broadcaster.  He has done over 3,000 webinars and will share his tips and tricks and offer attendees template-based webinar tools as handouts.  Editor, Sharyn Fitzpatrick has also been doing webinars for over a decade.  In their conversation, they shared best practices and advice on how to NOT do webinars.

You can find the recorded webinar on YouTube at https://youtu.be/p9AFUT8PWXg

 

 

 

XML Hacking, Part 1: An Introduction

With the introduction of Office 2007, Microsoft changed the basic file format that underlies Word, PowerPoint and Excel. Instead of the proprietary and mostly undocumented format that ruled from Office 97 to Office 2003, Microsoft made a smart decision and switched to XML. This is tagged text, similar in structure and concept to HTML code with which you may already be familiar.

XML opens up a world of possibilities for automated document construction, but that’s a topic for another day. The everyday relevance for you and I is that if a Word or PowerPoint file isn’t doing what you need it to do and there are no tools in the program for the job, we can now dive in a edit the file ourselves. If you’re a point-and-click user, this is probably not thrilling. But if you’re a hacker at heart, a midnight coder or just a curious tinkerer, you can do some cool stuff.

insidewordfile-pic-1

Inside a simple Word file. The document text is stored in document.xml.

The main tool you’re going to need is a text editor. While you can get away for a while with Notepad or TextEdit, those simple text editors don’t quite have the tools that get the job done efficiently. On Mac, I use BBEdit and on Windows I reach for Notepad++. BBEdit is reasonably-priced shareware and Notepad++ is freeware. They have a similar style of operation, so if you’re a cross-platform hacker it’s easy to switch between them. Notepad++ uses a plugin system, so you can add tools. For this job, you’re definitely going to want the free XML plugin.

Word, Excel and PowerPoint files in the new format are actually simple Zip files with a different file ending. Getting into them couldn’t be easier: if you’re using Windows, add .zip to the end of the file (a copy of the file, if it’s anything important). You’ll get a warning from your OS, but you know what you’re doing! Now unzip it. Out pop several folders of XML, plus a top-level file or two.

Note: OS X requires somewhat more care with handling expanded Office files, or they won’t open. Please see this article for the best procedure on a Mac.

Select one of the files and open it in your text editor. All the files have been linearized to minimize file size. This is where your XML tools come into play. In Notepad++, choose Plugins>XML Tools>Pretty Print (XML Only – with line breaks). If you’re using BBEdit, choose Markup>Tidy>Reflow Document. Now you have a nicely indented, easy-to-read page to edit. When you’re done, it’s not necessary to re-linearize. Word, PowerPoint or Excel will do that for you later.

A plain vanilla PowerPoint file: more complex than Word.

A plain vanilla PowerPoint file: more complex than Word.

For people using Window’s built-in zip utility, there is an easy mistake to watch out for. By default, unzipping a file in Windows creates a new folder named for the file being expanded. If, when you’re re-assembling the file, you include this top-level folder,

PowerPoint will raise an error about unreadable content in the presentation. To avoid this, first open the folder that Windows created. Select the _rels, docProps and ppt folders, plus the [Content_Types].xml file, then create a zip file from them.

XML hacking is useful for Excel or Word when you want to add additional color themes or when you need to rescue a corrupt document. But it really shines with PowerPoint, allowing you to create custom table formats, extra custom colors that don’t fit into a theme, setting the default text size for tables and charts and much more. This technique separates the PowerPoint pros from the wannabes.

Check out text editors and XML tools so you’re ready to hack! If you want to learn more about how to put some of this to practice, read my next article on XML Hacking: Default Table Text. 

About the Author:

johnkorchokJohn Korchok has been creating the world’s finest branded web pages and documents for more than 25 years. As of January 1, 2015, he is bringing his wealth of expertise to Brandwares from his previous company, Wordlab Systems. He is expert in HTML, CSS, JavaScript, PHP and VBA programming, is certified as a Microsoft Office Specialist Master, and is an award-winning technical writer. Connect with him on LinkedIn.

XML Hacking, Part 2: Setting the Default Table Text Size

Let’s start hacking some XML with a simple project: setting the default table text size. This article assumes you have read the introduction and have a suitable text editor installed. Mac users should also read XML Hacking: Editing in OS X.

When you insert a new table in PowerPoint, the default table text size is 18 points. Using XML hacking, we can set this to whatever point size the designer prefers. You can also set the text to appear in all caps. Following the previous post’s instructions, add .zip to the file ending and unzip the file. Look for the ppt folder and open it:

ppt-folder-xlm-2-pic-1

In the ppt folder is another folder called Slide Masters. If your sample presentation is typical, it has only one Slide Master, so you won’t be surprised to find that typically Slide Masters contains only one file, called slideMaster1.xml. Open this file in your text editor and reformat the XML to make it readable (XML Tools>Pretty Print in NotePad++, or Markup>Tidy>Reflow in BBEdit). Scroll down to near the end, looking for a tag called <p:otherStyle>. This is the section that formats default text in miscellaneous objects, like tables:

otherstyle

Default Table Text Levels

Within the other Style section, the 4th line starts with <a:lvl1pPr. Then the 14th line begins with <a:lvl2pPr. Each of these 10-line sections formats a different text level, with the 4th line starting the first and the 14th beginning the second level. A handy, if terse, reference to all the parameters is shown here. Not all of these are actually used in the context of a table. As one example, there are a:spcBef and a:spcAft for setting space before and after, but this is ignored by PowerPoint in a table. PowerPoint pays attention to the font size, the left margin, line spacing, alignment and whether it’s all-caps, small caps, bold and/or italic.

The font size is set by this line: <a:defRPr sz=”1800″ kern=”1200″>. sz=1800 is the font size in hundredths of a point, so 1800 gives us the default 18-point size. Since this is the first level that might well be used for table headings, you could set it to something like 1450 to get a 14.5 point result.

Since this first level can be used for headings, let’s make it all-caps while we’re at it. Edit the line to read <a:defRPr sz=”1450″ kern=”1200″ cap=”all”>. Done! (Please note, this can be used for headings, but the user must still use the Home>Increase List Level command to set the actual level of text for each section of the table. In PowerPoint 2016 for Mac, the command is called Indent More.)

Now proceed to the second level and set its point size. Something like <a:defRPr sz=”1200″ kern=”1200″>

Other useful attributes for <a:defRPr> include cap=”small” for small caps, b=”1″ for bold and i=”1″ for italics. In addition, spc=”400″ adds enough tracking to make 10pt text have about 1 character width between each pair. This latter parameter can be positive for wider spacing or negative to crunch text together.

Scroll down a little further: you’ll notice that there are 9 levels, though in a table you’ll probably only use the first 2 or 3. In typical Microsoft style, each level is indented further than the preceding one.

Compare level 1 with level 2:

<a:lvl1pPr marL=”0″
<a:lvl2pPr marL=”457200″

marL is the left margin. The units of measurement here are EMUs: English Metric Units. This is an invented measurement system that allows easy conversion between English and Metric. suffice it to say that 457200 EMUs is 1/2″. When I modify this section, I set all 9 levels to marL=”0″. I also set all lower levels to the same point size as the lowest designed level, level 2 in our example. That way, if a user keeps changing to a lower text level, the formatting remains the same.

Text alignment can also be set using the algn parameter. The useful settings are l (left), r (right), ctr (centered), just (justified), and dist (text is widespaced to evenly fill cell width). Of course, if you’re setting these, marL should be set to 0. The simplest way to experiment with these parameters is to set the styles in the main text placeholder of the Slide Master (the larger slide at the top of the slide master list). Then unzip the presentation, open ppt/slideMasters/slideMaster1.xml and examine the section. The section uses exactly the same syntax, so if you need bullets or unusual spacing in a table, you can set up to do it.

Here’s what the final file should look like, with the changes highlighted:

finalxml2

Preview the Effects

When you’re finished editing, save and close the file. In a folder window where you can see all the unzipped files, select the folders _rels, docProps and ppt, plus [Content_Types].xml:

filestozip

Zip them into a file that ends with the same file ending as the original presentation, usually .pptx. Open in PowerPoint, insert a table and test your new default font sizes. Please note, assigning these styles makes them available to the whole table, but to access them you still need to use Increase List Level, same as in an ordinary text placeholder. Unfortunately, there’s no way to automatically assign <a:lvl1pPr> to table headings and <a:lvl2pPr> to the body of the table, which would be cool and helpful.

original-vs-custom-table-text

About Author:

johnkorchok

John Korchok has been creating the world’s finest branded web pages and documents for more than 25 years. As of January 1, 2015, he is bringing his wealth of expertise to Brandwares from his previous company, Wordlab Systems. He is expert in HTML, CSS, JavaScript, PHP and VBA programming, is certified as a Microsoft Office Specialist Master, and is an award-winning technical writer. Connect with him on LinkedIn.

Pin It on Pinterest