Questions tagged [openxml]

Questions regarding reading and writing of Microsoft Office Open XML files either through direct manipulation of the XML files contained in a zip package or through the Microsoft Office Open XML SDK.

Office Open XML File Formats Official Standard

http://www.ecma-international.org/publications/standards/Ecma-376.htm

Microsoft Office Open XML SDK 2.0

http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en

3743 questions
10
votes
1 answer

Directly signing an Office Word document using XML

I'm trying to sign a Microsoft Office Word file using C# in direct XML format. There are some questions and ambiguousness arises here like: How should I fill in the digest values, what value should I exactly digest for each reference, and what…
lkn2993
  • 566
  • 7
  • 26
10
votes
4 answers

Automated Testing OpenXML SDK

I'm implementing ms word document generation using content controls and OpenXML SDK. I'd like to have some automated testing for that code (unit tests or some easy UI automation tests). Does anyone has expericnce with testing MS Word document…
Andrii
  • 2,402
  • 1
  • 19
  • 17
10
votes
1 answer

How to convert open xml string to word document c#

I am reading one element from code and I am getting Open XML string as a result. byte[] binary = Convert.FromBase64String(template.Attributes["body"].ToString()); string bodyContent = UnicodeEncoding.UTF8.GetString(binary); Now, I want to…
Mittal Patel
  • 808
  • 1
  • 22
  • 37
10
votes
1 answer

Do we need Office Installation to work with OpenXML?

I am working with OpenXML manipulating the document. Do we need to have office installed for opening document through OpenXML?
10
votes
1 answer

Coldfusion OpenXml Error: Could not load file or assembly 'DocumentFormat.OpenXml'

I am .net coder and I am really really new to ColdFusion. I wrote a .dll library which automatically generates an invoice. I needed to use the library from a ColdFusion application. I have successfully loaded the classes in my library as coldfusion…
jmesolomon
  • 563
  • 5
  • 15
10
votes
1 answer

How to center text in docx4j

I have a paragraph of text which I would like to appear in the center of the document. How can I do this in docx4j? I am currently using: PPr paragraphProperties = factory.createPPr(); //creating the alignment TextAlignment align = new…
Nick
  • 1,743
  • 6
  • 23
  • 38
10
votes
5 answers

Modify excel cell

Good morning, I would like to edit some cells from already existing excell file. I tried use EPPlus and normal OpenXml classes. However I failed. In both situation program won't crash but always return old (not modified) excel. Please, what am I…
Ademar
  • 1,418
  • 1
  • 17
  • 27
10
votes
3 answers

OpenXml Edit text in the header of a word file

I'm using Open XML and I should change the text in the header of a word file. To change a specific paragraph in the document I have used the following code: Dim body = wdDoc.MainDocumentPart.Document.Body Dim paras = body.Elements(Of…
invictus1306
  • 587
  • 1
  • 4
  • 19
10
votes
1 answer

C# OpenXML (Word) Table AutoFit to Window

Open a Word (2007/2010) document that has a table in it, select the table and right click, select AutoFit-->AutoFit to Window How can I implement this action in C# using the OpenXML SDK 2.5?
yazanpro
  • 4,512
  • 6
  • 44
  • 66
10
votes
2 answers

How can I modify the foreground and background color of an OpenXML TableCell?

I'm creating the table cell as follows: private static TableCell GetHeaderCell(string cellText) { var tc = new TableCell(new Paragraph(new Run(new Text(cellText)))); return tc; } I want it to be blue with white text. I've tried the…
DaveDev
  • 41,155
  • 72
  • 223
  • 385
10
votes
6 answers

How to read Excel XML (C#)

I wonder if there is an easy way to read Excel 2010 XML? This XML has a different structure than I used to read. Especially ss:index attribute (ss:Index**="7") makes things a bit more complicated EDIT: To explain better: I have file with XML…
Maciej
  • 10,423
  • 17
  • 64
  • 97
9
votes
1 answer

OpenXml: What is the difference between SdtBlock and SdtCell?

SdtCell and SdtBlock in OpenXml.Wordprocessing both serialize into so what is the difference? I assume one is a table cell, which is what the Microsoft documentation appears to imply. The details provided are sparse at best, please clarify.
emd
  • 1,173
  • 9
  • 21
9
votes
1 answer

Get a CheckBox in Word using OpenXML

How does one get a handle to a CheckBox control that's embedded in a Word document using OpenXML? You would think that either Paragraph.ControlPropertiesPart or Paragraph.Descendents() would achieve something but in every single case I get a null…
Phil.Wheeler
  • 16,748
  • 10
  • 99
  • 155
9
votes
3 answers

C# & OpenXML: Insert an image into an excel document

I am using a modified version of this code to create an excel document, add cells, and style cells. I am trying to modify this code to also be able to add images to a sheet. I am getting nowhere and there really is nothing on the web that will…
Ian Herbert
  • 1,071
  • 2
  • 16
  • 35
9
votes
1 answer

OpenXML sdk Modify a sheet in my Excel document

I create an empty template in excel. I would like to open the template and edit the document but I do not know how to change the existing sheet. That's the code: using (SpreadsheetDocument xl = SpreadsheetDocument.Open(filename, true)) {…
Dario
  • 101
  • 1
  • 7