Questions tagged [openxml-sdk]

The Open XML SDK for Microsoft Office is built on top of the System.IO.Packaging API and provides strongly typed part classes to manipulate Open XML documents.

Open XML is an open ECMA 376 standard and is also approved as the ISO/IEC 29500 standard that defines a set of XML schemas for representing spreadsheets, charts, presentations, and word processing documents. Microsoft Office Word 2007, Excel 2007, and PowerPoint 2007 and later versions all use Open XML as the default file format.

The Open XML file formats are useful for developers because they use an open standard and are based on well-known technologies: ZIP and XML.

The Open XML SDK for Microsoft Office is built on top of the System.IO.Packaging API and provides strongly typed part classes to manipulate Open XML documents. (Use version 2.5 whenever possible as it fixes some problems in version 2.0.) The SDK also uses the .NET Framework Language-Integrated Query (LINQ) technology to provide strongly typed object access to the XML content inside the parts of Open XML documents.

The Open XML SDK simplifies the task of manipulating Open XML packages and the underlying Open XML schema elements within a package. The Open XML Application Programming Interface (API) encapsulates many common tasks that developers perform on Open XML packages, so you can perform complex operations with just a few lines of code.

Above is taken from the Overview section here.

In 2015 the Open XML SDK was made open source, public on GitHub. Version 2.6.0 was released which fixes a bug in the way it works with System.IO.Packaging. It is otherwise the same as 2.5. More details are available here.

1516 questions
0
votes
1 answer

How do I open an already openeded presentation with PresentationDocument.Open() for PowerPoint Add in?

I have a PowerPoint Add in that create, modify and save presentations. Specific options for the opened presentation should be stored in this presentation file (.pptx) using Open XML, when i try to do this I get an…
Khalil_B
  • 59
  • 7
0
votes
0 answers

watermarking a word document using OpenXML sdk

I followed the watermarking code given below: using System; using System.Collections.Generic; using System.Linq; using System.Text; using DocumentFormat.OpenXml; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.Vml; using…
0
votes
1 answer

OpenXML IsolatedStorage threading

According to this article OpenXML is not thread safe when it's "MemoryStreams reach the high water mark" and has to switch to IsolatedStorage. This occurs on workbooks smaller than even 1mb because the UNCOMPRESSED data is likely 10x that size. …
Shawn K
  • 779
  • 5
  • 13
0
votes
0 answers

OpenXML PowerTools HtmlConverter adding unnesssary table borders

I am working on a project where I have to convert a DOCX -> PDF as generic as possible and automated. We decided to go with OpenXML for the find and replace of fields that need updating and the HtmlConverter that is listed here as an extension to…
gcoleman0828
  • 1,541
  • 3
  • 30
  • 49
0
votes
0 answers

OpenXml: Replace Excel "previewimage" in a PowerPoint presentation

I am creating an application in C# (using OpenXML) that based on a PowerPoint template iterates through the slides and replaces all images with SSRS-reports. This works perfect for images, but one of the elements is an embedded excel sheet which…
femseks
  • 2,914
  • 3
  • 23
  • 20
0
votes
0 answers

Adding a enumerated list as content control and binding data in MS docx

I have a content control field as 1 of the items in a enumerated list. How can I add further items (unknown number of items) to the list so that the item number gets incremented? For eg this is the MS Word formatted enumerated list: a) A sentence…
Qwerty
  • 323
  • 1
  • 6
  • 33
0
votes
1 answer

Extracing a Stream from ImagePart

I have a w:pict/Picture within a run, to which I am trying to get the Stream of, to copy it to another part of the document. I've taken the relationship (Id = r1), and loaded the part from the MainDocumentPart, to be given a CustomXmlPart (which…
Stuart.Sklinar
  • 3,683
  • 4
  • 35
  • 89
0
votes
1 answer

Append word document to an existing document using OpenXML and C#

I want to append the content of an existing .docx document (including all formatting/styles) to another existing document. I found the following link but its more for duplication rather than addition: Duplicating Word document using OpenXml and…
Soul Slayer
  • 297
  • 1
  • 6
  • 17
0
votes
2 answers

open xml sdk excel formula recalculate after cell removal

I have a formula cell C4 that needs to recalculate after I enter a value in another cell C2. but the C4 keeps getting cached and keeps returning old cached value. I have asked this question multiple times on SO but I am not getting any help. I am…
dotnet-practitioner
  • 13,968
  • 36
  • 127
  • 200
0
votes
2 answers

Need to modify innerxml of a paragraph using openxml 2.5

I am attempting to modify innerxml of paragraph of a word document but the innerxml property refuses to be set. Following is the code I have tried: static void Main(string[] args) { string destinationWordFile = @"C:\Users\Testing\Modified…
Vipul
  • 107
  • 2
  • 4
  • 13
0
votes
1 answer

OpenXML PowerPoint files won't open on IOS 7 devices

Similar to this question, I was having trouble opening OpenXML 2.5 documents on my iPad. After some trial and error, I found this xml tag: < Override PartName="/ppt/presentation.xml"…
northben
  • 5,448
  • 4
  • 35
  • 47
0
votes
1 answer

Cannot Locate DocumentFormat.OpenXml.Office2010.Word.DrawingShape Namespace in Open XML SDK 2.0 for Microsoft Office

According to the documentation for Open XML SDK 2.0 for Microsoft Office I should be able to use DocumentFormat.OpenXml.Office2010.Word.DrawingShape (along with many other namespaces prefixed by DocumentFormat.OpenXml.Office2010) with my Word 2010…
TiVo
  • 11
  • 1
  • 4
0
votes
1 answer

Why does footer style change after copying it with OpenXML from another Word document?

When I copy the footer from a Word template to another Word document the font style and size changes in the middle paragraph of footer what consists more than one Run. How can I copy the style of it (font style, size, etc.)? Can anyone…
sada
  • 584
  • 2
  • 8
  • 25
0
votes
1 answer

Reading contents from xlsx file using DocumentFormat namespace in C#

How to read rows one by one by its column name from xlsx file using C# or making use of DocumentFormat namespace. Please help..! Thanks.
user3122164
  • 137
  • 1
  • 1
  • 12
0
votes
1 answer

OpenXML SDK: Is there a command to "refresh" the spreadsheet that was created?

I write applications that create PDF files and Excel files. While generating PDF files, I noticed that some of the features that were inserted in the file, did not show up visually. I was informed of a statement that "refreshes" the file and now all…
Travis Banger
  • 697
  • 1
  • 7
  • 19