Chapter 10. Using LINQ with Office 2007

In This Chapter

  • Considering the structure of Office 2007 documents

  • Interacting with Office 2007 using LINQ

  • Performing the required setup

  • Developing an Office 2007 document application

You can use LINQ for an interesting array of application types, including Microsoft's new Office Open XML (OOXML) file format in Office 2007. As the name implies, OOXML uses XML files to store document data. Microsoft relies on other methods to organize the data as well, so one of the first issues this chapter tackles is a quick look at the file structure.

These new OOXML file formats have a different file extension than before. For example, Word users will find that Word 2007 now supports DOCM for documents with macros and DOCX for documents without macros. In both cases, the file content actually appears as a series of specially constructed XML files. The only difference is that one has macros and the other doesn't, so you can use either form with LINQ. Naturally, you have to follow a certain process when working with the files, so this chapter discusses process concerns as well.

The remainder of the chapter helps you discover OOXML as it relates to LINQ. You discover that you can easily query an Office 2007 document for information, modify the information as needed, and save the changes back to disk. Queries can include all kinds of interesting information — everything from document content to custom properties. Consequently, you could even build your own custom ...

Get LINQ For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.