|
|
Browse by Tags
All Tags » OpenXML » LINQ (RSS)
-
[Blog Map] Excel has a very cool feature where you can declare that a range of cells is a table. It is a feature that allows you to use Excel very much like a database. You can add new rows as necessary, sort the table by columns, do some simple filtering, calculate the sum of columns, and more. Each table has a unique table name, and each column has a name unique to its table. Because these tables are stored in Open XML documents, we can implement some simple extension methods and some classes so Read More...
|
-
I’ll be presenting two sessions on the Open XML SDK at Tech Ed 2008 EMEA in Barcelona. OFC206 - Open XML SDK Version 2 Overview and Architecture (November 12, 13:30 - 14:45) In this session, I’ll present an overview of V2 of the Open XML SDK. I’ll talk a bit about the architecture of the Open XML formats. I’ll then compare and contrast the Office object model and the Open XML SDK, and the key benefits from using the SDK. We’ll discuss the architecture of the Open XML SDK, and the roadmap for the Read More...
|
-
[Blog Map] Anders Hejlsberg presented a fascinating and entertaining session at PDC 2008 on C# 4.0 . He talked about dynamic typing, optional and named parameters, improved COM interoperability, and improved support for co-variance and contra-variance. These language improvements are very cool – they enable us to write code that more closely expresses our intent, with less syntactic noise. Carve out some time, and watch his PDC session . Anders is a dynamic presenter, so you won’t be bored! Dynamic Read More...
|
-
You can build very powerful document assembly solutions using the Open XML SDK V2 literally in just a few minutes. In our presentation at PDC 2008, amongst other demos, Zeyad Rajabi and I will demonstrate this in a live coding session. We'll be using the LINQ friendly features of the SDK. It really is a quite a remarkable set of tools, and if you are an Open XML aficionado, you really should attend our session! But even more important than that, we really want to see you, and hear your questions Read More...
|
-
Many types of documents contain code, including API documentation, tutorials, specifications, technical books, and magazine articles. Too often, there is no way to automate testing and validation of this code. This post presents a small example program that shows how to use content controls in Open XML word documents to delineate code snippets so that you can automate validation of the snippets. This scenario was my first use of Open XML – it was the killer application (for me) that prompted me to Read More...
|
-
Today, the development team for the Open XML SDK has announced that they have released the first Community Technology Preview (CTP) of version 2 of the Open XML SDK. Download it at http://go.microsoft.com/fwlink/?LinkId=127912 . There is a lot of very cool stuff in this release, including: Strongly typed document object model (DOM). Tool to compare two Open XML files. Class explorer that helps you understand the markup and determine which classes to use in the strongly typed DOM. Document reflector Read More...
|
-
Content controls are an effective way to add structure to word processing documents. You can write a very small LINQ query to retrieve the contents of content controls. This topic in Office Online provides more information on content controls. In an upcoming post, I’m going to show how you can write a small test harness to test code that is embedded in documents. This is particularly useful, say, to a program manager who has written a specification that contains a lot of code that shows how to use Read More...
|
-
This post presents a snippet of code to remove comments from an Open XML Wordprocessing document. Note: This post may be of interest to LINQ to XML developers, as it contains some information that helps you write queries that perform better. In the case of very large documents, the approach described below performs much better than other approaches. The code is very simple: remove all w:commentRangeStart, w:commentRangeEnd, and w:commentReference elements in the main document part, and then remove Read More...
|
-
This post presents some code to remove personal information from an Open XML word processing document. Note: this post contains interesting information for LINQ to XML developers even if you are not interested in removing personal information from a document. It demonstrates some easy ways to write robust code in LINQ to XML that behaves properly even if we don't know the original state of the document. For instance, it shows how to write very short, robust code to remove an element that doesn't Read More...
|
-
This is a fun, geeky post for those interested in functional programming. Sometimes you have flat data where there is hierarchy expressed in the data, but the form of the data is flat. You may need to transform this data into a hierarchy, such as an XML tree. For instance, you may have the following data: Heading [] headings = new [] { new Heading { Level = 1, Text = "Intro" }, new Heading { Level = 2, Text = "Hello" }, new Heading { Level = 2, Text = "Summary" }, new Heading { Level = 1, Text = Read More...
|
-
In this post, I’m presenting some code that uses the Open XML SDK and LINQ to XML to query an Open XML document. I’ve posted on this before , but this version is cleaner and smaller. It also is an example of code written in the functional style. The most common need is to retrieve the paragraphs of a word processing document. But I've also had the need to dig into a spreadsheet, and get the data out for a row, a set of rows, or all the cells in a column. You can think of the code presented here as Read More...
|
-
In our family, we have a rule – on Mother's day, my wife basically gets to set the agenda for the entire weekend. And, as appropriate, she doesn't have to lift a finger around the house. And on Father's day, the same rule applies for me. But on all other weekends, normal rules apply. This year, because my wife was out of town on the actual Father's day, we shifted Father's day to this last weekend, and my choice for how to spend the weekend was to write the code that I'm presenting here, and to write Read More...
|
|
|
|