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
36
votes
5 answers

Inserting Image into DocX using OpenXML and setting the size

I am using OpenXML to insert an image into my document. The code provided by Microsoft works, but makes the image much smaller: public static void InsertAPicture(string document, string fileName) { using (WordprocessingDocument…
LunchMarble
  • 5,079
  • 9
  • 64
  • 94
31
votes
9 answers

Replace image in word doc using OpenXML

Following on from my last question here OpenXML looks like it probably does exactly what I want, but the documentation is terrible. An hour of googling hasn't got me any closer to figuring out what I need to do. I have a word document. I want to add…
fearofawhackplanet
  • 52,166
  • 53
  • 160
  • 253
29
votes
3 answers

Save Open XML as PDF

As part of an investigation into enterprise level server side document generation I have come across Open XML. For those that have used this, how successful were you? Would you recommend it? Can you save the OpenXML to PDF directly or would I need…
Gineer
  • 2,358
  • 4
  • 26
  • 40
29
votes
8 answers

Append multiple DOCX files together

I need to use C# programatically to append several preexisting docx files into a single, long docx file - including special markups like bullets and images. Header and footer information will be stripped out, so those won't be around to cause any…
ShootTheCore
  • 449
  • 1
  • 5
  • 8
28
votes
11 answers

Replace Text in Word document using Open Xml

I have created a docx file from a word template, now I am accessing the copied docx file and want to replace certain text with some other data. I am unable to get the hint as to how to access the text from the doument main part? Any help would be…
Incredible
  • 3,495
  • 8
  • 49
  • 77
27
votes
2 answers

how can I change the font open xml

How can I change the font family of the document via OpenXml ? I tried some ways but, when I open the document, it's always in Calibri Follow my code, and what I tried. The Header Builder I think is useless to post private static void…
Lucas_Santos
  • 4,638
  • 17
  • 71
  • 118
26
votes
4 answers

Applying % number format to a cell value using OpenXML

I want to apply the % (percentage) number format using open XML C# I have numeric value 3.6 that I want to display that number in excel as `3.6%. How do I achieve that?
Selwyn
  • 1,621
  • 6
  • 21
  • 38
26
votes
4 answers

Simplify/ Clean up XML of a DOCX word document

I have a Microsoft Word Document (docx) and I use Open XML SDK 2.0 Productivity Tool to generate C# code from it. I want to programmatically insert some database values to the document. For this I typed in simple text like [[place holder 1]] in the…
K B
  • 1,330
  • 1
  • 18
  • 30
26
votes
1 answer

What are the differences between the EPPlus and ClosedXML libraries for working with OpenXML?

I'm trying to choose between ClosedXML, EPPlus, and possibly SpreadsheetLight. What reasons might I consider for picking one over the others?
llasarov
  • 2,064
  • 5
  • 27
  • 40
25
votes
3 answers

OpenXML Multiple Sheets

I am adding multiple sheets to an excel workbook. I want to have one row on one sheet and the other row on the other sheet. This code puts both rows on both sheets. Any ideas on how to fix this? SpreadsheetDocument ssDoc =…
Reed
  • 309
  • 1
  • 4
  • 8
25
votes
4 answers

C# OPEN XML: empty cells are getting skipped while getting data from EXCEL to DATATABLE

Task Import data from excel to DataTable Problem The cell that doesnot contain any data are getting skipped and the very next cell that has data in the row is used as the value of the empty colum. E.g A1 is empty A2 has a value Tom then while…
Vikas Bansal
  • 10,662
  • 14
  • 58
  • 100
25
votes
2 answers

Add HTML String to OpenXML (*.docx) Document

I am trying to use Microsoft's OpenXML 2.5 library to create a OpenXML document. Everything works great, until I try to insert an HTML string into my document. I have scoured the web and here is what I have come up with so far (snipped to just the…
JasCav
  • 34,458
  • 20
  • 113
  • 170
24
votes
5 answers

Merge multiple word documents into one Open Xml

I have around 10 word documents which I generate using open xml and other stuff. Now I would like to create another word document and one by one I would like to join them into this newly created document. I wish to use open xml, any hint would be…
Incredible
  • 3,495
  • 8
  • 49
  • 77
24
votes
2 answers

Where to find Office 2007/2010/2013 Open XML Schemas

I am looking to pull together all of the XML schemas that Office 2007/2010/2013 documents abide by. I have found a number from the ISO/IEC 29500:2012 spec and ECMA-376 spec. I have also located a few on w3.org (e.g. xmldsig#). But I have been unable…
Michael Gunter
  • 12,528
  • 1
  • 24
  • 58
24
votes
7 answers

Interop.Word Documents.Open is null

I am trying to open .docx file and convert to PDF using Interop.Word.Application. It works as console application but If I use the same in my web application it doesn't work. I tried to see the permissions on the folder. I gave 'Network Service'…
nav100
  • 2,923
  • 19
  • 51
  • 89