Handy Visual Studio Add-In to View Office 2007 Files

Published 29 July 08 03:21 PM

Last month when I was in Redmond I mentioned to a colleague that I really liked the Open XML format that Office 2007 was using now and how I had been playing with the format and LINQ to XML. He pointed me to the VSTO Power Tools which contains a Visual Studio Add-In called the Open XML Package Editor. This tool allows you to view Office 2007 files from Word, PowerPoint and Excel in a neat little treeview that lets you navigate the Open XML file and manipulate all the parts individually. After installing the VSTO Power Tools, just double-click on the Office 2007 file directly from your Visual Studio project to open the tool.

<From the VSTO Power Tools documentation:>

Open XML Package Editor

This is a Visual Studio 2008 add-in to allow parsing and editing of Open Packaging Conventions files, including Word, Excel and PowerPoint documents. Features include:

  • Open any Office 2007 Open XML Package file or XPS Package file directly in Visual Studio.
  • Intuitive, browsable tree view of the Package file.
  • Open any XML part directly in Visual Studio's rich XML editor.
  • Easy to use user interface for adding and removing parts and relationships.
  • Import and export part contents to and from files.
  • Detects when a Package file that is opened in Visual Studio is modified externally. Prompts user to reload without having to close any open XML part editors.
  • Create new Office Packages from a set of templates using Visual Studio's File > New dialog.

Figure 1 shows the treeview that is provided when you open an Open XML Package file in Visual Studio:

From the treeview, if you double-click on any XML part in the file, that part will be opened in the standard Visual Studio XML editor, as shown in Figure 2:

 

<end docs>

One thing I noticed is that if the XML editor opens and the XML is all on one line with no breaks then just select all the contents and cut then paste it back into the editor and it will put the proper line breaks in there for you (Ctrl + A,X,V).

There are nine other tools included in the VSTO Power Tools that I highly recommend trying out if you are doing any kind of Office development with Visual Studio. Also check out the VSTO Team Blog and VSTO Developer Portal for more information on Office development with Visual Studio.

Enjoy!

Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Pregnant Man &raquo; Handy Visual Studio Add-In to View Office 2007 Files said on July 29, 2008 7:14 PM:

PingBack from http://wordnew.acne-reveiw.info/?p=14240

# Beth Massi - Sharing the goodness that is VB said on July 30, 2008 10:31 PM:

About a month ago the OpenXML SDK 1.0 (June 08 update) was released . The SDK provides strongly typed

# Office Development with Visual Studio said on October 2, 2008 5:22 PM:

If you missed the announcement on the VSTO Developer Portal , the team released a tool called AddInSpy

Leave a Comment

(required) 
(optional)
(required) 

About Beth Massi

Beth is an Online Content and Community Program Manager on the Visual Studio Community Team responsible for producing content for business application developers and driving community features onto MSDN Developer Centers (http://msdn.com/). She also produces content on her blog (http://blogs.msdn.com/bethmassi), Channel 9 (http://channel9.msdn.com/), and a variety of other developer sites. As a Visual Basic community champion and a long-time member of the Microsoft community she also helps with the San Francisco East Bay .NET user group and is a frequent speaker at various software development events. Before Microsoft, she was a Senior Architect at a health care software product company and a Microsoft Solutions Architect MVP. Over the last decade she has worked on distributed applications and frameworks, web and Windows-based applications using Microsoft development tools in a variety of businesses. She loves teaching, hiking, mountain biking, and modifying cars.
Page view tracker