PowerPoint Tutorials   PowerPoint Templates   PowerPoint Blog

XML Editing in Visual Studio Express with 7-Zip

Explore how you can edit PowerPoint presentations and templates and also Office Themes within Visual Studio Express with a little help from 7-Zip.

A PPTX file or any of the new file formats that Office 2007 and later use such as POTX or THMX are different than the older binary file formats such as PPT. That's because these new file formats that end with an “X” are essentially XML based file formats.

Even more interesting is the fact that the actual file is not an XML based file but only a wrapper that contain many disparate and related XML based elements. The wrapper technology used is just simple ZIP technology. If you want to edit Office XML files, you will therefore need to unzip, edit, and finally zip the file. Alternatively, you can perform XML Editing within Visual Studio 2010. While the former process is time consuming and error prone, the latter process requires that you buy a copy of Visual Studio 2010 – a product that is expensive and no longer available! Unfortunately, the process of editing Office XML files does not work as well in later versions of Visual Studio.

There is a third, more effective way of achieving the same results using 7-Zip and Visual Studio Express -- both of these products are free!

This technique of using 7-Zip and Visual Studio Express was discovered by Echo Swinford -- thank you so much, Echo. Here's a link to her original article.

Echo has also co-authored Building PowerPoint Templates with Julie Terberg -- this book is a great resource for anyone who works with PowerPoint templates.

Before you start, you must have these two programs installed:

  1. Download 7-Zip and install.
  2. Download Visual Studio 2010 Express. You just need Visual Basic 2010 Express rather than the entire Visual Studio 2010 Express package. Yoy will be required to sign with your Microsoft Account. Do sign up for a free visual Studiodev Essentials account to access the download. Even if you downloaded the entire Visual Studio 2010 Express package, you can opt to install just the Visual Basic part, as shown highlighted in red within Figure 1, below.

  3. Figure 1: Visual Basic 2010 Express is all you need

Once both the programs are installed on your computer, follow these steps:

  1. Launch 7-Zip File Manager from the Start menu. This opens the 7-Zip File Manager window, as shown in Figure 2. Within this window, click the Tools option (highlighted in red within Figure 1). From the resultant drop-down menu, select Options.

  2. Figure 2: 7-Zip File Manager window
  3. This opens the Options dialog box as shown in Figure 3 -- within this dialog box, select the Editor tab (highlighted in red within Figure 3). Then click the Browse button, highlighted in blue within Figure 3.

  4. Figure 3: Editor tab
  5. Navigate to, and select the vbexpress.exe file as shown highlighted in red within Figure 4. This file will be typically located within the C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE folder. Thereafter, click the Open button.

  6. Figure 4: vbexpress.exe file selected
  7. This will take you back to Options window. Click the OK button here to proceed.
  8. Then, using the navigation bar (highlighted in red within Figure 5) access the folder where your PPTX / POTX / THMX file is located. Select the file which you want to edit -- make sure you just click once to select the file (don't double click).

  9. Figure 5: PPTX file to be edited is selected
  10. With the PPTX / POTX / THMX file selected, choose the File | Open Inside menu option, as shown in Figure 6.

  11. Figure 6: File | Open Inside menu option
  12. This opens the selected PPTX / POTX / THMX file within the 7-Zip File Manager with all of its content, as shown in Figure 7. Here select the ppt folder (refer to Figure 7 again).

  13. Figure 7: PPTX file opened within the 7-Zip File Manager
  14. Now, navigate to and select the XML file you want to edit. For example, we selected the ppt\theme\theme1.xml file, as shown in Figure 8.

  15. Figure 8: XML file to be edited is selected
  16. With the XML file selected, make sure you do not double-click! Instead, choose the File | Edit menu option as shown in Figure 9.

  17. Figure 9: File | Edit menu option
  18. This will open the selected XML file within Visual Basic Express, as shown in Figure 10.

  19. Figure 10: Selected XML file opened within Visual Basic Express
  20. To view the entire document for easier editing, select the Edit | Format Document menu option as shown in Figure 11. You can also use the keyboard sequence Ctrl+K, Ctrl+D in quick succession.

  21. Figure 11: Edit | Format Document menu option
  22. This displays the document code hierarchically, as shown in Figure 12. Make edits as required. For example, we wanted to change the Theme name (text highlighted in orange within Figure 12) and Theme Color name (text highlighted in pink within Figure 12).

  23. Figure 12: Entire document's code view
  24. Change the text just by selecting the old text and typing the new one. We changed both the Theme name and the Theme Color name to 'Test 1" as shown in Figure 13.

  25. Figure 13: Theme name and Theme Color name changed
  26. Once done, save the XML file using the Ctrl+S keyboard shortcut and close the Visual Basic Express interface. This opens a 7-Zip message window as shown in Figure 14.

  27. Figure 14: 7-Zip message window
  28. Click OK and your editing work is completed.
  29. Now if you open your edited PPTX / POTX / THMX file within PowerPoint, you can see the changes. Figure 15 shows our sample PPTX file in PowerPoint 2010. Notice the Theme name (highlighted in red within Figure 15) and Theme Colors name (highlighted in blue within Figure 15) changed to "Test 1".

  30. Figure 15: PowerPoint presentation reflecting the changed Theme name and Theme Color name

See Also:

Themes – XML Editing: XML Editing in Visual Studio Express with 7-Zip (Index Page)