openxml

Generate Power Point Documents Wrapper DLL

天大地大妈咪最大 提交于 2019-12-13 04:38:13
问题 We are generating various Power Point documents on a regular basis using the built in automation in Office. This is problematic since natively power point and other office automation will not run in the background on a server without some hacks. Even with the hacks in place there are still some limitations and regular issues. Because the OpenXML is so radically different from the Application automation and due to how involved the steps are, I was hoping to find a third party or shared dll

Open XML SDK 2.0

只愿长相守 提交于 2019-12-13 04:05:24
问题 I'm trying to follow this tutorial to made a Word doc template that i can manipulate using C#. But i always get the following error: "The name 'mainPart' does not exist in the current context open XML". I'm using Open Xml 2.0. Any idea of what am i missing? using System; using System.IO; using DocumentFormat.OpenXml.Packaging; .... Console.WriteLine("Starting up Word template updater ..."); //get path to template and instance output string docTemplatePath = @"C:\Users\user\Desktop\Doc Offices

Ribbon not showing up with dynamically generated ribbon XML from the database

一曲冷凌霜 提交于 2019-12-13 03:57:34
问题 I am trying to form ribbon XML with the data from the database and following is what I wrote:- XNamespace xNameSpace = "http://schemas.microsoft.com/office/2006/01/customui"; XDocument document = new XDocument(); document.Add( new XElement (xNameSpace+"customUI" , new XElement("ribbon" , new XElement("tabs")))); // more code to add the groups and the controls with-in the groups ....... // code below to add ribbon XML to the document and to add the relationship RibbonExtensibilityPart

Word 2010 + Save math equation as image

冷暖自知 提交于 2019-12-13 03:21:08
问题 how can I save a math equation (from a word document) as an image, using c#?? Perhaps, I should use openxml sdk ? Anyone can help? 回答1: Save the document as Word 97-2000 (i.e. .doc instead of .docx) then save the document as a webpage. All equations will be saved as image in the for_img directory. 来源: https://stackoverflow.com/questions/6533984/word-2010-save-math-equation-as-image

Table text gets extra spacing after running through word automation services

不打扰是莪最后的温柔 提交于 2019-12-13 02:38:14
问题 I'm generating a document from a bunch of template documents and in addition I'm adding some tables as html altChunk s (because it's a lot easier than trying to create a table with OpenXML). This all worked fine and gave me the result I wanted. But, because of some deficiencies with the way altChunk were being processed by some versions of Word (especially on the Mac) and the inability to automatically update the TOC, we decided to set it up to run our reports through word automation services

Format Font Inside Table OpenXML C#

天涯浪子 提交于 2019-12-13 02:37:19
问题 I want to make table using OpenXML WordProcessing. I want to format the font inside the cell. This is my code MainDocumentPart mainDocumentPart = doc.AddMainDocumentPart(); mainDocumentPart.Document = new Document(); Body body = mainDocumentPart.Document.AppendChild(new Body()); RunProperties runHeader = new RunProperties(); RunFonts runFont = new RunFonts(); runFont.Ascii = "Lucida Sans"; runHeader.Append(runFont); runHeader.Append(new Bold()); runHeader.Append(new FontSize() { Val = "16" })

Excel “found unreadable content” error opening a xlsx created from C#

早过忘川 提交于 2019-12-13 02:26:28
问题 I'm creating an Excel file (xlsx) from C# using OpenXML. When I create a xlsx file and I open, it has no error. When I try to attach that file on an e-mail and send it, Excel returns the message "found unreadable content" opening the attached file, with Yes/No button to continue. Clicking on Yes the file is opened correctly. This is my code to attach an xlsx file: byte[] bt = functionToCreateXlsxfile(); MailMessage message = new MailMessage(); System.Net.Mail.Attachment attach = new System

Open XML in dnx5.0 / aspnext

蹲街弑〆低调 提交于 2019-12-13 02:17:35
问题 I'm trying to build an app that uses OpenXML in a dnx/aspnet next environment. I've added added the OpenXML dependency to my package.json "dependencies": { .... "DocumentFormat.OpenXml": "2.5.0" } However, when i try to run, i get this error: The type 'Package' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=4.0.0.0 It seems OpenXML depends on WindowsBase. I'm fearful that this won't work in linux/mac environment, as I can't find a

Minimal style sheet for Excel Open XML with dates?

孤人 提交于 2019-12-13 00:39:43
问题 I'm trying to create an Excel file using the Open XML SDK with the minimal style sheet needed that will allow me to format a cell as a date. Below is my attempt at a style sheet: <?xml version="1.0" encoding="utf-8"?> <x:styleSheet xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <x:cellXfs count="1"> <x:xf numFmtId="14" xfId="0" applyNumberFormat="1" /> </x:cellXfs> </x:styleSheet> Even without referencing this style from a cell, Excel tells me that my file is corrupt. If

Inconsistent visualization of numerical values in Excel 2007 vs the underlying xml file

一个人想着一个人 提交于 2019-12-12 23:12:15
问题 I am attempting to read an Excel 2007 file (xlsx) from outside of Excel and I am finding an inconsistency that I cannot explain. If you enter the value of 19.99 into a cell and then look at the underlying Xml document it is actually stored as 19.989999999999998. This is not the only value that does this, but it is a reasonable example. No formatting is applied in the sheet. In my example I just open a new Workbook, type in 19.99 in A1 and save the file. I have attempted to open this simple