ooxml

From Excel to DataTable in C# with Open XML

I'm using Visual Studio 2008 and I need create a DataTable from a Excel Sheet using the Open XML SDK 2.0. I need to create it with the DataTable columns with the first row of the sheet and complete it with the rest of values. Does anyone have a example code or a link that can help me to do this? ...

what exactly does the SDK v2 take care of that you would have to do manually when coding by hand with an XML library?

This is closely related to another question I asked: Is there functionality that is NOT exposed in the OpenXML SDK v2? I am currently working with OpenXML files manually. I recently had a look at the SDK and was surprised to find that it looked pretty low level, quite similar in fact to the helper classes I have created myself. My quest...

Child's index with XPath

I'm hacking the OOXML format with XPath and it contains some 0-based arrays. What I want to do is get the indices of individual elements. For example: <parentNode> <childNode type="string" /> <childNode type="integer" /> <childNode type="boolean" /> </parentNode> Here I can find the desired element with the expression "/...

Is there a dev kit/lib (written in c or c++) to write docx files?

Is there a dev kit/lib (written in c or c++) to write docx files? Microsoft has a dev kit, but it's written in C#. ...

How to add a comment to a cell in Excell 2007 using the Open XML SDK 2.0?

I'm posting this question and answer to help anyone else that might need this bit of code in the future. I had a hard time finding a complete code sample or even an explanation of how to add a comment to an Excel cell. Hopefully this will help someone in the future. ...

Launch OLE editor while inserting an OLE object in Microsoft Word

In the word object model, one can you use following API to launch OLE editor while inserting an OLE object. Trick is not to pass OLE content(thru fileName) but pass just classtype of OLE. InlineShape AddOLEObject(ref object ClassType, ref object FileName, ref object LinkToFile, ref object DisplayAsIcon, ref object IconFileName, ref o...

How to repeat similar fields in a word template?

Hello, I am delving into the realm of programmatically editing a word document based on a template. If for example, the template had a section in it for My address, and they wanted my past addresses going back 5 years, and I have moved 3 times, I will have to put in 3 addresses. Obviously the fields here are exactly the same, but I want...

Open xml SDK Save a template file (.xltx to .xlsx)

I have the following code to open excel template file and save it as .xlsx file and I get the error below when I try to open the new file. Please help to resolve this. Excel cannot open the file ‘sa123.xlsx’ because the file format or the extension is not valid. Verify that the file has not been corrupted and that the file extension mat...

Limiting an XPath predicate: predicate starting with ...

I am navigating this office open xml file using XPath 1.0 (extract): <sheetData ref="A1:XFD108"> <row spans="1:3" r="1"> <c t="s" r="A1"> <is> <t>FirstCell</t> </is> </c> <c t="s" r="C1"> <is> <t>SecondCell</t> </is> </c> ...

OpenXML scheme color transformations - applying <a:gamma> and <a:invgamma>

When processing an open xml document, colors can have various transformations applied to a base color to generate a relative color. For instance <a:satMod value="25000"> would modify the base colors saturation by 25%. There are two transforms I have been able to find very little information on and they are: <a:gamma> The docs say "Th...