Sections
Open XML
Functional Programming / LINQ to XML
PowerTools for Open XML
Useful Code Snippets
Writing / Other
SharePoint Web Services / LINQ to XML / Open XML Tutorial
SharePoint
Open XML SDK and LINQ to XML
Using LINQ to Query Excel Tables
Transforming Open XML Documents using XSLT
Transforming Open XML Documents to Flat OPC Format
Transforming Flat OPC Format to Open XML Documents
The Flat OPC Format
Creating Data-Bound Content Controls using the Open XML SDK and LINQ to XML
Create a List of All Parts in an Open XML Document
OpenXmlCodeTester: Validating Code in Open XML Documents
Using LINQ to XML to Retrieve Content Controls in Word 2007
Remove Comments
Remove Personal Information
Accept Revisions
Automated Processing of Open XML Documents using PowerShell
Extract Comments
OpenXML Content Types in an XML Document
Bulk Convert DOC to DOCX
The Legacy Hashing Algorithm in Open XML
How to Use altChunk for Document Assembly
Inserting / Deleting / Moving Paragraphs in an Open XML Document
Remove Rsid Elements and Attributes before Comparing Open XML Documents
Inner Join of Two Excel Tables
Joining LINQ to SQL and LINQ to Excel
Working with In-Memory Open XML Documents
Comparing Two Open XML Documents using the Zip Extension Method
Splitting Runs in Open XML Word Processing Document Paragraphs
Comparison of Navigating Parts between System.IO.Packaging and the Open XML SDK
Merging Comments from Multiple Open XML Documents into a Single Document
Using DocumentBuilder with Content Controls for Document Assembly
Comparison of altChunk to the DocumentBuilder Class
Generalized Approach to Open XML Markup References
Interrelated Markup in Open XML Word Processing Documents
Creating a Template Open XML Document in Memory
Finding Paragraphs by Style Name or Content in an Open XML Word Processing Document
Seven Key Benefits of Open XML
Move/Insert/Delete Paragraphs in Word Processing Documents using the Open XML SDK
Essentials of the Open Packaging Conventions
Functional Programming Tutorial – C# 3.0
Functional Programming Tutorial – VB 9.0
Using Annotations to Transform LINQ to XML Trees in an XSLT Style
Performance of LINQ to XML
Performance of Chained Queries
Atomized XName and XNamespace Objects
Preatomization of XName Objects
Statically Compiled Queries
Writing Robust LINQ to XML Code that Performs Well
Closures
LINQ to TEXT and LINQ to CSV
Chunking a Collection into Groups of Three
Use a Lambda Expression for an Event Handler
Find Duplicates using LINQ
Generating a LINQ to XML Tree from Anonymous Types
How to Create Hierarchy from Flat Data using LINQ
The GroupAdjacent Extension Method
The SkipLast Extension Method
Formatting LINQ Code
Using LINQ to XML Events and Annotations to Track if an XML Tree has Changed
Use INFER.EXE to Create XML Schemas
Are Developers Using LINQ?
Are Developers Using LINQ? (Part 2)
Anders Hejlsberg Introduces C# 4.0 at PDC 2008
Debugging LINQ Queries
Comparing LINQ to XML and XPath
A More Robust Approach for Handling XName Objects in LINQ to XML
Writing Succinct Code to move XElement and XAttribute Objects from One LINQ to XML Tree to Another
Align Attributes when Formatting XML using LINQ to XML
Getting Started with SharePoint (WSS) Web Services using LINQ to XML
Working with Optional Elements and Attributes in LINQ to XML Queries
Querying LINQ to XML Nodes in Reverse Document Order with Better Performance
Document-Centric Transforms using LINQ to XML
Recursive Approach to Pure Functional Transformations of XML
Computing Deep Hash Codes using LINQ to XML
Equality Semantics of LINQ to XML Trees
Manually Cloning LINQ to XML Trees
The Composability Thought Process for LINQ
Ease of Maintenance of LINQ Code
Ease of Maintenance of LINQ Code (2)
XML Element and Attribute Name Guidelines
Why I Don’t Use the ForEach Extension Method
Detailed Description of PowerTools for Open XML cmdlets
The Use of Extension Methods to Manage Open XML Document Changes in PowerTools for Open XML
Getting Started with PowerTools for Open XML Development
Announcing the Release of PowerTools for Open XML V1.1
Release of PowerTools for Open XML v1.1.1
Generating a Custom Letter using PowerTools for Open XML and PowerShell
Fastest Start for LINQ to SQL
Running an Executable and Collecting the Output
Writing for Professional Developers
Thoughts on Technical Writing for a Large Audience
An Approach to Reading Specifications Quickly
Modifying Open XML Documents that are in SharePoint Document Libraries usingWeb Services
Accepting Revisions, Removing Comments, and Removing Personal Info from a SharePoint Document Library using Web Services
Removing Comments and Personal Information, and Accepting Revisions in an Open XML Document Stored in SharePoint
Modifications to web.config for Debugging SharePoint Components
SharePoint at the Intersection
Modifying Open XML Documents from within the SharePoint Object Model
PingBack from http://osrin.net/2008/10/eric-white-has-too-much-to-say/
Hi Eric,
I have gone through some of your blogs related to openxml and they really helped me alot to learn and use openxml concepts in my current project that i'm working on. I have few issues in coding to extract embedded objects like excel, ppt from word document using openxml, C# and linQ.
var runs = from l_run in paragraph.Runs
let l_run_styleNode = l_run
.Elements(w + "rPr")
.FirstOrDefault()
let l_run_inheritStyle = l_run
.Elements(w + "rStyle")
let l_run_graphics = l_run
.Elements(w + "drawing")
let l_run_Objects=l_run
.Elements(w + "object")
select new
{
Run = l_run,
RunType = l_run.Name.LocalName,
CssStyles = l_run_styleNode != null ? CreateCssProperties(l_run_styleNode.CreateReader()) : "",
CssClass = l_run_inheritStyle != null ? (string)l_run_inheritStyle.Attribute(w + "val") : "",
Text = l_run.Descendants(w + "t").StringConcatenate(element => (string)element),
BreakBefore = l_run.Element(w + "br") != null,
ExternalRelationId = (l_run.Name == w_hyperlink ? (string)l_run.Attribute(rels + "id") : ""),
Graphics = l_run_graphics,
Excels=l_run_Objects
};
.....
by using above query i could able to fetch the object from the document.xml file but retrieving the actual object from that is not working ... the code is here...
foreach (var run in runs)
var excels = from l_excels in run.Excels
let l_excels_oleobject = l_excels
.Descendants(a + "imagedata")
.Where(xlz => xlz.Attributes(rels + "id") != null)
XLExternalRelationId = l_excels_oleobject != null ? (object)l_excels_oleobject.Attributes(rels + "id") : ""
}
the above query didn't return any data from it...so can you plz guide me on this....
Thanks,
Ramakrishna
XNamespace w = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
XNamespace rels = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
XNamespace a = "http://schemas.openxmlformats.org/drawingml/2006/main";
these are the namespaces i'm using....for the above post...
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