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
12
votes
3 answers

Using C# & Powerpoint OpenXML, is it possible to change the font size and color of text

I am using openXML and C# to generate a powerpoint slide but I can't seem to figure out how to change / set the text size and color. Is this possible and are there any example as I can't seem to find any with googling? I am building out a table…
leora
  • 188,729
  • 360
  • 878
  • 1,366
12
votes
4 answers

How to convert xls file to xlsx file using C#?

I was developing an application which read data from an excel file, but when I try to open it, an exception  was thrown if the source file is saved with the xls format (File contains corrupted data error when opening Excel sheet with OpenXML).…
Hamzatovic
  • 121
  • 1
  • 1
  • 3
12
votes
3 answers

OpenXML - Cell.DateType is null

I can't determine when a Cell is a date. I noticed the DataType is null so I can't distinguish if it's a Number of a Date. I am using the next code to extract the cells: WorksheetPart worksheetPart =…
12
votes
3 answers

OpenXML tag search

I'm writing a .NET application that should read a .docx file nearby 200 pages long (trough DocumentFormat.OpenXML 2.5) to find all the occurences of certain tags that the document should contain. To be clear I'm not looking for OpenXML tags but…
weirdgyn
  • 886
  • 16
  • 47
12
votes
2 answers

How do you add text wrapping to a cell using OpenXml when creating excel files?

How do you set the format of a text cell to wrap when generating .xlsx files with OpenXml? Here is the code I have currently: public void Excel() { var viewModel = new RequirementIndexData(); viewModel.Requirements =…
12
votes
3 answers

How to add section break next page using openxml?

I want to add a section break at the end of the document and add some text. My code is as below: using System; using System.Collections.Generic; using System.Linq; using System.Text; using DocumentFormat.OpenXml.Packaging; using…
Mohemmad K
  • 809
  • 7
  • 33
  • 74
12
votes
1 answer

What is the meaning of t="shared" in a formula element?

When inspecting a cell element in XLSX file, I find the following formula element: What is the meaning of such a formula element?
alancc
  • 487
  • 2
  • 24
  • 68
12
votes
4 answers

Excel 2003 XML format - AutoFitWidth not working

I have a program that spits out an Excel workbook in Excel 2003 XML format. It works fine with one problem, I cannot get the column widths to set automatically. A snippet of what I produce:
Peter
  • 3,563
  • 5
  • 30
  • 43
12
votes
2 answers

Is There An Open Source XSLT To Convert a WPF FlowDocument to WordML?

I want to use a WPF RichTextBox which allows users to edit and format text. This formatted text will eventually work its way into a Word document along with some of our other custom XML data. I've found several examples going from WordML to a…
bporter
  • 4,467
  • 2
  • 19
  • 29
12
votes
1 answer

How to get rid of my "After Spacing" on open xml

In open XML my word document defaults to having "Spacing After: 10 pt" How would I change it to 0, so there is no spacing. Here is my code, which pretty much grabs the information from a database and places it onto a word document to be able to…
AustinT
  • 1,998
  • 8
  • 40
  • 63
12
votes
6 answers

Duplicating Word document using OpenXml and C#

I am using Word and OpenXml to provide mail merge functionality in a C# ASP.NET web application: 1) A document is uploaded with a number of pre-defined strings for substitution. 2) Using the OpenXML SDK 2.0 I open the Word document, get the…
TonE
  • 2,975
  • 5
  • 30
  • 50
11
votes
2 answers

How to insert line break within OPENXML spreadsheet cell?

I'm currently using something like this to insert inline string in a cell : new Cell() { CellReference = "E2", StyleIndex = (UInt32Value)4U, DataType = CellValues.InlineString, InlineString = new InlineString(new Text( "some…
belaz
  • 1,486
  • 5
  • 18
  • 33
11
votes
3 answers

How to replace an Paragraph's text using OpenXML Sdk

I am parsing some Openxml word documents using the .Net OpenXml SDK 2.0. I need to replace certain sentences with other sentences as part of the processing. While iterating over the paragraphs, I know when I've found something I need to replace, but…
Chaitanya
  • 5,203
  • 8
  • 36
  • 61
11
votes
2 answers

Embed contents of a RTF file into a DOCX file using OpenXML SDK

In our old MSWord-97 based system we use COM to interact with a .doc file, and embed an OLE object, so the embedded document is visible in the parent (not as an icon). We're replacing this with a system using OpenXML SDK since it requires having…
Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
11
votes
1 answer

How to group rows/columns in EPPlus

Is there a way to achieve this in EPPlus? Only thing I could find on the internet is grouping specific data for example: AAA ---> AAA 5 occurrences AAA BBB 2 occurences BBB BBB AAA AAA AAA but not visually like in…
Edito
  • 3,030
  • 13
  • 35
  • 67