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

openXML spreadsheetdocument return byte array for MVC file download

I'm trying to return a openXML spreadsheetdocument as a byte[] which I can then use to allow my MVC to send that file to a user. here is my spreadsheetdocument method to return the byte array using (MemoryStream mem = new MemoryStream()) { …
Canvas
  • 5,779
  • 9
  • 55
  • 98
11
votes
3 answers

OpenXML distance, size units

What are the measurement units used to specify sizes or X,Y cordinates in OpenXML? (Presentation). Does it makes sense to match those with pixels, if so how can be those converted to pixels? graphicFrame.Transform = new Transform(new Offset() { X =…
BuddhiP
  • 6,231
  • 5
  • 36
  • 56
11
votes
3 answers

OpenXML replace text in all document

I have the piece of code below. I'd like replace the text "Text1" by "NewText", that's work. But when I place the text "Text1" in a table that's not work anymore for the "Text1" inside the table. I'd like make this replacement in the all…
TheBoubou
  • 19,487
  • 54
  • 148
  • 236
11
votes
4 answers

OpenXml Cannot open package because FileMode or FileAccess value is not valid for the stream

The stream comes from an html form via ajax var jqXHR = data.submit(); public static GetWordPlainText(Stream readStream,string filePath) { WordprocessingDocument.Open(readStream, readStream.CanRead); } [HttpPost] public ActionResult FileUpload()…
hidden
  • 3,216
  • 8
  • 47
  • 69
11
votes
2 answers

Default WordML Unit Measurement ? pixel or point or inches

Please clarify the my doubt WordML/DOCX Default Unit Measurement is pixel or point or EMU or inches.. ?
it'sme
  • 531
  • 6
  • 23
11
votes
1 answer

OLE DB vs OPEN XML SDK vs Excel.interop

I need to read XLSX files and extract a maximum amount of content from it. Which of the API's should I use? OLE DB, open XML SDK, or Excel Interop? Which is the easiest to use? Can you retrieve all the information using one or the other? i.e,…
cecemel
  • 616
  • 2
  • 7
  • 22
10
votes
1 answer

Writing Bitmap to OpenXML ImagePart via MemoryStream

I have an image stored in a Bitmap object that I'd like to stick into an OpenXML document. I've tried using a MemoryStream as an intermediate step as follows: ImagePart part = container.AddNewPart("image/jpeg", imageId); using…
Matthew Jacobs
  • 4,344
  • 1
  • 20
  • 20
10
votes
4 answers

Can I use the Open XML SDK in Mono?

Can the Open XML SDK be used in Mono?
akosch
  • 4,326
  • 7
  • 59
  • 80
10
votes
2 answers

How to programmatically insert comments into a Microsoft Word document?

Looking for a way to programmatically insert comments (using the comments feature in Word) into a specific location in a MS Word document. I would prefer an approach that is usable across recent versions of MS Word standard formats and implementable…
mac
  • 9,885
  • 4
  • 36
  • 51
10
votes
4 answers

Reading dates from OpenXml Excel files

I'm trying to read data from the .xlsx files using SharpZipLib to unpack it (in memory) and reading the inner xml files. Everything is fine but recognizing the dates - they're stored in julean format and I need to somehow recognize if a number is a…
brovar
  • 811
  • 4
  • 10
  • 25
10
votes
1 answer

DocumentFormat.OpenXml in Ubuntu server

I have a basic C# application where Open XML SDK is used. I want to make it run in my Nginx & Ubuntu & DigitalOcean server. The application compiles and works well in Windows, and my Mac with mono. Then, I installed mono in the Ubuntu server, and…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
10
votes
1 answer

apply background color to specific cell in excel using openxml

Following is the code I have and in the final method below, I do all the operation. Please ignore the return types of methods, I have changed it later. public static byte[] CreateExcelDocument(List list, string filename) { …
Matt Murdock
  • 159
  • 1
  • 2
  • 11
10
votes
1 answer

How can I create a Package on a memory stream

Is it possible to create a System.IO.Packaging.Package on a memory stream. I'd like to avoid the file system and do everything in memory if possible. However, the only way to create a Package is to call Package.Open which accepts a stream. However,…
user380719
  • 9,663
  • 15
  • 54
  • 89
10
votes
4 answers

Is there a dev kit/lib (written in c or c++) to write docx files?

Is there a dev kit/lib (written in c or c++) to write docx files? Microsoft has a dev kit, but it's written in C#.
Kevin
  • 111
  • 4
10
votes
7 answers

Conditional formatting color gradient with hard stops

I have a column of data in an Excel sheet which has positive and negative values. What I want to be able to do is apply conditional formatting (a color gradient) from say dark green to light green for positive values and light red to dark red for…
Matt Burland
  • 44,552
  • 18
  • 99
  • 171