Getting started with the Open XML SDK 2.5 for Office
The Open XML SDK 2.5 for Office simplifies the task of manipulating Open XML packages and the underlying Open XML schema elements within a package. The classes in the Open XML SDK 2.5 encapsulate many common tasks that developers perform on Open XML packages, so that you can perform complex operations with just a few lines of code.
Note
Interested in developing solutions that extend the Office experience across multiple platforms? Check out the new Office Add-ins model. Office Add-ins have a small footprint compared to VSTO Add-ins and solutions, and you can build them by using almost any web programming technology, such as HTML5, JavaScript, CSS3, and XML.
Using the Classes in the Open XML SDK
Using the classes in the Open XML SDK 2.5 is simple. When you have installed the Open XML SDK 2.5, open your existing project or application in Visual Studio, or create a new project or application. Then, in your project or application, add references to the following components.
- DocumentFormat.OpenXml
- WindowsBase
To add a reference in a Microsoft Visual Studio 2008 project
- In Solution Explorer, right-click References and then click Add Reference. If the References node is not visible, click Project and then click Show All Files.
- In the Add Reference dialog box, click .NET.
- In the Component Name column, select the components (scroll if you need to), and then click OK.
Tip
To select more than one component, hold down the Ctrl key and click each component.
The added components are displayed in the References section in Solution Explorer.