openxml

Replace string in Word doc - Works in MainDocumentPart not in HeaderPart

Hi! I need to do a simple search and replace of a string in a word document. I thought it would be pretty easy, but it's not (at least for me) Check out this code (It takes a stream, opens the different part of the doc, searches for the string, and then it replaces it). Problem is that only whats inside the MainDocumentPart and the Fo...

OpenXML 2 SDK - Word document - Create bulleted list programmatically

Using the OpenXML SDK, 2.0 CTP, I am trying to programmatically create a Word document. In my document I have to insert a bulleted list, an some of the elements of the list must be underlined. How can I do this? ...

Schema/DTD of PowerPoint

I am looking for a way to add some meta-infromation to PowerPoint files. Specifically, I want to add annotation to bullets and slides. Are there any XML attributes which can be added to the elements (of the slideX.xml file) without invalidating it? In other words, where can I find the schema/DTD of the slideX.xml files? ...

How much has Open XML caught on?

I'm curious as to how many people are using Open XML (OOXML) these days (either pure or via the SDK) in closed and commercial environments. I'm fairly aware of what's going on on the 'public web' (MSDN, OpenXMLDeveloper.org, etc.), but am wondering about SO people's experience with it, both good and bad. Are most people opting out of VB...

Update subtotals in excel files

I using the OpenXML library to take a datatable and paste it into a pre formatted excel file. This works fine. The problem I have is there is a subtotal row at the top of the pre-formatted excel file, that is set to subtotal each column of this data (so there is a subtotal at the top of each column). When I open the excel file after it...

Duplicate column names are not allowed in result sets obtained through OPENQUERY and OPENROWSET

How can I get the second column with the same column name using OPENXML in MSSQL 2005? Here is the result set that I plan to get. columnData1 columnData2 A B C D E F DECLARE @hDoc int, @xmldata varchar(max) SELECT @xmldata = '<?xml version="1.0" encoding="utf-8" ?> <reportResponse> <reportDataRow rowNum="1"> <columnData colNum...

Best approach, Dynamic OpenXML in T-SQL

hello, i'm storing XML values to an entry in my database. Originally, i extract the xml datatype to my business logic then fill the XML data into a DataSet. I want to improve this process by loading the XML right into the T-SQL. Instead of getting the xml as string then converting it on the BL. My issue is this: each xml entry is dynami...

Using VBA to Copy special symbols from one PowerPoint presentation to another

I need to copy text from one PowerPoint presentation to another. However, I have problems copying special symbols, such as smileys, which appear in the target presentation as empty boxes. Looking at the Open XML file in the original presentation, I can see that the Run containing the smiley has a "SymbolFont" attribute: < a:sym typeface...

Finding rightmost cell in an Excel document in .Net

I'm reading an Excel document via the DocumentFormat.OpenXml library. Is there a good way to find out how many columns it has? The current code, which I've just come across while investigating a bug, does this: public string getMaxColumnName(SheetData aSheetData) { string lLastCellReference = aSheetData.Descendants<Cell>().Last()....

Could i use OpenXml for editing XPS Files?

Hello, i guess OpenXml is designed for Office products, but editing XPS files with OpenXml is out of question? ...

Why does OPENXML seem to perform better than XQuery in this case?

I wrote the script below in order to test the performance difference between OPENXML and the newer functions available for the XML datatype in SQL Server 2005. When I run the script (with the option to include the actual execution plan), the results were strange. The execution plan said that the cost of the first query (using OPENXML) ...

reading a large open xml spreadsheet

i need to read (and parse) large spreadsheet files (20-50MB) using the openxml libraries and there doesn't seem to be a way to stream the rows one at a time for parsing. i'm consistently getting Out Of Memory exceptions as it seems as soon as i attempt to access a row (or iterate) the entire row contents are loaded (100K+ rows). each ...

How do you change the content of a content control in Word 2007 with OpenXml SDK 2.0?

About to go mad with this problem. I'm sure it's so simple I'm just missing it, but I cannot for the life of me find out how to change the content of a content control in Word 2007 with the OpenXml SDK v2.0 in C#. I have created a Word document with a plain text content control. The tag for this control is "FirstName". In code, I'd like...

.NET OpenXML SDK 2 RunProperties are Null

Hello, I'm trying to read Word 2007 docx document. The document looks fine inside Word, but when i try to read id using my code, all Run objects have RunProperites set null. The property that I'm most interested in is RunProperies.FontSize, but unfortunately it is null as well, the only property I can access is InnerText. My Code l...

Where is list of defined format styles for Excel using the OpenXML sdk

I'm using the OpenXML SDK 2.0, and I want to know where the list of defined format styles (and their values) is kept. Specifically, I want to know date/time formats. I want to open an xcel file, read a cell, and try to determine (based on format/style) if it is a date or date time value. Conversely, if I write data to a xcel file, and...

Displaying SpreadSheet (OpenXML) cell styling in ASP.NET

I would like to display Excel SpreadSheet on the webpage. Seems like when I am using ADO.NET I can only access to data but is there some way so I can also know which rows/cols are formatted in special way like headers? ...

Update Word doc's table of contents part automatically using .NET?

In Word 2007, you can right-click on a table of contents area and tell it to update its page numbers to point to wherever the current page of that link is. I'd like to do this programmatically, without COM, with the DocumentFormat.OpenXml assemblies. I'm having some troubles Googling it due to the nature of the phrase "table of contents,...

Create HTML table and open it in Excel with saving style

Hello:) Did anybody export tables from HTML Document to Excel with saving all css styles? My app can generate html code for table but i need to export зrecisely same table to Excel. I use OpenXML. May be it is necessary to use urn:schemas-microsoft-com:office:excel and urn:schemas-microsoft-com:office:spreadsheet namespaces? Thanks all...

Comparing Docx files using OOXML

How can I read word-by-word (with styles) from a docx file. I want to compare two docx files word-by-word and based on the differences I have to write into another docx file (using c# and OOXML). I have tried achieving this by using DocumentFormat.OpenXml.Extensions.dll, OpenXMLdiff.dll and ICSharpCode.SharpZipLib.dll but nothing is givi...

C# API for MS Word Equation editor

Dear all; Is there an API (preferably C#) to access the object model of equations created with MS Word's equation editor? I am looking for an API like the chart object to access properties of charts in Excel, for instance. Any help would be much appreciated. ...