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

Selecting Excel rows with data in first column via Linq

I'm trying to select just the rows from an Excel spreadsheet that have data in the first column. Here's the code I'm using: IEnumerable dataRows = from row in worksheet.Descendants() where (row.RowIndex > 2 …
Steve
  • 543
  • 1
  • 6
  • 14
0
votes
1 answer

How does one get the font color for a run/txbody/paragraph from a presentation theme?

I'm working on a PresentationML parser, and I'm trying to implement support for themes with regard to font color. I'm working with the SDK, and I've puzzled out this…
Chris B. Behrens
  • 6,255
  • 8
  • 45
  • 71
-1
votes
1 answer

How can I set the text codification of my open xml document

How can I set the text codification of my open xml document ? In Office 2003, when I open a document that was build through Open XML, a error appears about codification, like that. How can I set the codification or how can I fix this error ? I…
Lucas_Santos
  • 4,638
  • 17
  • 71
  • 118
-1
votes
0 answers

Trouble Adding Image to Word Document using Open XML SDK

I'm currently working on a project where I need to programmatically add images to a Word document in C#. I've been following the official documentation and various tutorials, but I seem to be running into an issue where the image is not being added…
Mac Man
  • 1
  • 1
-1
votes
1 answer

How to programmatically get core properties of office open XML document in C++

I have to get core properties like author, keyword from Microsoft Office (open xml) document(docx, pptx, xlsx) through C++ code. I know there is open XML SDK for that but it solely designed for .NET. I found multiple links telling about the solution…
dev
  • 649
  • 9
  • 11
-1
votes
1 answer

Find and replace to create new word document and convert to pdf in ASP.NET Core

I want to find and replace some variables in a Word document to form a new document (the old one is still intact). The new Word document is then sent as a PDF to customers. I have been able to do the find and replace and created a new XML…
techstack
  • 1,367
  • 4
  • 30
  • 61
-1
votes
1 answer

The name 'c' does not exist in the current context using OpenXml-sdk and C# for accessing Word file

I am using c# and open xml sdk 2.0 for accessing Word file after upload on the server. I want to retrieve a chapter and paragraph based on the given text. The chapters are insert on the table chapter The chapters and paragraphs are insert on the…
Chevy Mark Sunderland
  • 401
  • 2
  • 10
  • 21
-1
votes
1 answer

word template(.dotx) automation through c# with tables

I have a word template (.dotx) that contains two tables. for (int j = 0; j < 2; j++) { Range range = tables[3].Range; range.Copy(); Range rng = tables[3].Range; rng.SetRange(tables[4 + i].Range.End + 2, tables[4 +…
suneel
  • 1
  • 2
-1
votes
1 answer

Styles Format Openxml

I am trying to build a document with Openxml, when i add a style to the styles.xml and try to validate it, i get the following error The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:rFonts' here…
RRJCoetzer
  • 21
  • 5
-1
votes
1 answer

update word Customxml part using of OpenXml API, but can't update "document.xml" in Main Document

we update custom xml part using C# code. we are successfully update document in widows. but can we open this document in Linux environment, it could not be changed value. how can we achieve change of custom xml part in windows as well as…
-1
votes
1 answer

create a new document from word template with multiple pages using documentformat.openxml

I have a Microsoft Word template with some content controls. It contains a table of contents and some extra information. On the page, I have set some content controls where I would like to inject a new text from a RESTful service. If the RESTful…
Burre Ifort
  • 653
  • 3
  • 15
  • 30
-1
votes
1 answer

Create DOCX file with support for RTL (hebrew, arabic) using C# .NET

In the last several weeks i have figured that DOCX (XCEED) component does not support Hebrew really good, if i write something in Hebrew (Or Arabic) and need dot or colon at the end of the line, they appear at the beginning. I'm still waiting for…
Y.G.J
  • 1,098
  • 5
  • 19
  • 44
-1
votes
1 answer

Word Processing Document open Word(docx) get "The specified package is invalid. The main part is missing" error

Get "The specified package is invalid. The main part is missing" from WordProcessingDocument.Open() I have two files: One is original file and another is Save As version from the original file. Original get error at WordprocessingDocument.Open. Save…
Yin How
  • 89
  • 1
  • 7
-1
votes
1 answer

OpenXML unable to read spreadsheet data after editing in Excel

I am using OpenXML in order to export some translation data to an Excel spreadsheet and then importing the same spreadsheet back into my program. Now this works perfectly fine if I just export and import straight away, however, if I open op the…
Ezzy
  • 1,423
  • 2
  • 15
  • 32
-1
votes
1 answer

How to add paragraph at the end of 15th page of word document using wordprocessing document c#

I used WordprocessingDocument to add the paragraph at the end of a word after the last paragraph, but I need to add this paragraph at the end of the 15th page in a word document. Below is my code adding the paragraph at the end of the…
Arbenita Musliu
  • 95
  • 4
  • 11
1 2 3
99
100