Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Useful Code Snippets   (RSS)
Generating Documents from SharePoint Lists using Open XML Content Controls
[Blog Map] It's often the case that a department manager needs to regularly send a nicely formatted status report to her general manager or that a team leader needs to send a weekly status report to a number of interested parties. To collaborate with Read More...
Source Code Available: Complete Implementation of 'Accept All Changes (Tracked Revisions) in Open XML Documents'
[Blog Map] As most Open XML developers know, Word 2007 has a feature that tracks changes while you are editing a document. These tracked revisions are recorded in Open XML markup. It often is desirable to use the Open XML SDK to process tracked revisions Read More...
DescendantsAndSelfTrimmed LINQ to XML Axis Method
[Blog Map] There are some circumstances where I need a variation on the DescendantsAndSelf axis method that allows me to specify that specific elements (and the descendants of those elements) are ‘trimmed’ from the returned collection. One of the things Read More...
Merging Comments from Multiple Open XML Documents into a Single Document
Microsoft Word 2007 allows you to lock a document, prohibiting users from making changes to content, while allowing them to add comments. If we have multiple documents that have the same content yet different comments, we can merge those comments into Read More...
Recursive Approach to Pure Functional Transformations of XML
[Blog Map] Writing pure functional transformations a in a recursive style enables us to put together interesting transformations in a very small amount of code. Using some specific techniques that allow us to write this code very concisely, this approach Read More...
Document-Centric Transforms using LINQ to XML
[Blog Map] When thought of in a certain way, XML documents come in two flavors – data-centric and document-centric. Further, there are two types of document-centric documents. This post presents my thoughts about approaches to various types of document-centric Read More...
Comparing Two Open XML Documents using the Zip Extension Method
[BlogMap] (Note: this is a post on comparing two Open XML word processing documents. For a post on comparing two XML documents, see Equality Semantics of LINQ to XML Trees .) Sometimes we want to compare two word processing documents to see if they contain Read More...
Splitting Runs in Open XML Word Processing Document Paragraphs
[Blog Map] (July 1, 2009 - Updated TransformRun to be recursive) In Open XML Word processing document markup, paragraphs contain runs, and runs contain text elements. Sometimes when transforming a document, we may want to split runs differently than in Read More...
Querying LINQ to XML Nodes in Reverse Document Order with Better Performance
[Blog Map] (Update June 25, 2009 - fixed bugs in event handlers associated with deleting last node and inserting node at beginning of list) Occasionally I need to query LINQ to XML nodes in reverse document order. I’m currently writing some LINQ to XML Read More...
Comparison of Navigating Parts between System.IO.Packaging and the Open XML SDK
Code highlighted in yellow shows navigating from the package to the main document part. Code highlighted in green shows navigating from the main document part to the styles part. using System; using System.Linq; using System.IO; using System.IO.Packaging; Read More...
Creating a Template Open XML Document in Memory
One of the most effective ways to generate Open XML documents, spreadsheets, or presentations is to start with a ‘template’ document and then modify the document. For instance, you can start with a blank word processing document that is set up with your Read More...
Ease of Maintenance of LINQ Code (2)
[Blog Map] In two previous posts , I developed a somewhat involved query to search through a word processing document for style names and/or paragraph content. This is a query that I’m developing for the PowerTools for Open XML project . In those posts, Read More...
Ease of Maintenance of LINQ Code
[Blog Map] I believe that it is easier to maintain code that is written in the functional style. For one thing, this is the very reason for many of the characteristics of functional code. No state is maintained, so we don’t have to worry about corrupting Read More...
Finding Paragraphs by Style Name or Content in an Open XML Word Processing Document
[Blog Map] About a week ago, I posted a very interesting guest post by Bob McClellan , where he discussed some code that allows you to more easily move/insert/delete paragraphs in Open XML documents. He is in the process of putting together a PowerShell Read More...
Move/Insert/Delete Paragraphs in Word Processing Documents using the Open XML SDK
[Blog Map] (Update March 27, 2009 - updated the Headers and Footers section, and added the Charts section.) We can potentially make extensive modifications to Open XML word processing documents. Many scenarios would benefit from the ability to move paragraphs Read More...
More Posts Next page »
Page view tracker