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
2 answers

Word Open XML: file corrupted if more than 3 images are inserted

I'm having some troubles with OPEN XML during the image creation. I'm replacing some Text inside the document with some images. If I replace 1 to 3 images the saved file is perfect: the images are shown and everything looks good. If I replace more…
Ziba Leah
  • 2,484
  • 7
  • 41
  • 60
0
votes
1 answer

C# TimeSpan to Excel in Open XML

I'm working on a project to create a bar graph showing times in a MS Word 2010 document. The main program stores these times in a List I created an example word document using the Insert Chart feature in Word, and made a bar chart with…
Alex
  • 689
  • 1
  • 8
  • 22
0
votes
1 answer

using C# with the Open XML SDK 2.5 how can you set a cell's value individual characters to specific individual font colours

I want to colourise my amino acids 1 letter codes automatically from the c# from which they are currently output. The spreadsheet is output correctly and I have a column such as this example: A B 1 KJAGLKJGKASLJG 2 FLFSFHDSHDSHHF 3 KJSDALKDJKLFJK 4…
Aalawlx
  • 593
  • 5
  • 25
0
votes
1 answer

DOCX: Field code that evaluates to empty string as field result

I need to insert the field in the word document which ultimately evaluates to empty string. Some ideas I've; - Set intersection: both sets have nothing in common and finally field result would lead to empty. - "".concats(""), leads to "" Can we…
unknown_boundaries
  • 1,482
  • 3
  • 25
  • 47
0
votes
1 answer

Save SpreadsheetDocument in the DB

I have a valid SpreadsheetDocument object created from the stream. I can manipulate it (f.e. add new row). After my changes I need to save this changed document in SQL Server as varbinary and later read it for SQL Server to manipulate further. Could…
0
votes
1 answer

table finding from doc file using openxml

I want to edit the values in rows of table in doc file using openxml package in c sharp code. Here I am showing the code for finding table but it gives me null and if i use default instead of firstordefault then its gives me exception like sequence…
0
votes
1 answer

How can I manipulate docx at runtime

My task is to take docx file, manipulate it, fill placeholders and return it to a user. I have C# project that consists of several webservices that makes it work. By now I have done it following way: Take docx file Open it via OpenXML SDK Apply…
0
votes
1 answer

Open XML iterated table binding to word document

I have to bind iterated tables to word document using open xml. I.I can able to bind single table to word document. i am able to bind single table header 1 shown in image using book mark. Could you please provide some ideas to bind multiple tables…
MaheshMajeti
  • 187
  • 12
0
votes
0 answers

How to get all merge fields of table row using open xml

I want to get all merge fields of a table row within a word document . I used code as below but I am not getting all merge fields- IEnumerable tables = docGenerated.MainDocumentPart.Document.Body.Descendants
(); foreach (Table table in…
0
votes
0 answers

How to get formatted word document's content using OpenXML?

I'm using this code for reading a word document's contents and save the content into a PDF file using iTextSharp library: WordprocessingDocument wordprocessing = WordprocessingDocument.Open(stream, false); Body body =…
Sirwan Afifi
  • 10,654
  • 14
  • 63
  • 110
0
votes
1 answer

Extract the content of excel file

I use Open XML to load excel file,I want to extract all content of cells.First I try to get the format code and the inner text of the cell, but it seems that Open XML SDK does not provide the functionality of formatting the inner text with the…
Aaron
  • 21
  • 2
0
votes
1 answer

parse Xdocument to Open XML word processing document

I have one xml string I have created that using string some string functions. eg.
0
votes
0 answers

OpenXML SDK: get presentation shape location

How does one accuire the location and size of shapes on the slide of PowerPoint presentation? I'm able to accuire it from Transform2D property of title slide (the very first), but every other slide's Transform2D is null. Checked the XML's for some…
YOhan
  • 505
  • 3
  • 6
  • 17
0
votes
1 answer

How to go from Worksheet to SpreadsheetDocument?

My OpenXML SDK-based application iterates through workbooks and inside that, through worksheets. I would like to factor out the retrieval of the worksheet. Given a Spreadsheet.Worksheet, how do I find its parent…
oleworldcoder
  • 83
  • 2
  • 10
0
votes
2 answers

Word 2013 Nested Repeating Section Content Controls

I'm having a problem nesting repeating section controls within other repeating section controls. Imagine I'm enumerating servers in vm hosts in environments in datacenters Datacenter1 Environment1 VMHost1 Server1 …
JoeBrockhaus
  • 2,745
  • 2
  • 40
  • 64