openxml

How to save (and open) an Open XML document as Excel file?

对着背影说爱祢 提交于 2019-12-20 06:19:38
问题 I have an Open XML document. I would like to know how to save it as an .xlsx file. I tried opening Excel software and did Developer -> Import but that opened my XML file as Excel - but it literally opened the XML file as an XML document and did not open it as an Excel version of an Open XML document. This is the Open XML document I have: <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas

How can I improve the performance of retrieving values from SharedStringTable in OpenXml Excel spreadsheet tools?

Deadly 提交于 2019-12-20 05:19:06
问题 I'm using DocumentFormat.OpenXml to read an Excel spreadsheet. I have a performance bottleneck with the code used to look up the cell value from the SharedStringTable object (it seems to be some sort of lookup table for cell values): var returnValue = sharedStringTablePart.SharedStringTable.ChildElements.GetItem(parsedValue).InnerText; I've created a dictionary to ensure I only retrieve a value once: if (dictionary.ContainsKey(parsedValue)) { return dictionary[parsedValue]; } var fetchedValue

How to install OpenXML SDK Productivity Tool 2.5 on Windows 10

五迷三道 提交于 2019-12-20 04:19:23
问题 I downloaded the OpenXML SDK Productivity Tool 2.5 from Microsoft's Website However when I want to install it, I get told I need to install .NET Framework 4 first and the install won't continue without it. I already have .NET Framework 4.6 installed. I have installed Visual Studio 2015 Update 1. You should have .NET Framework 4.0 installed before you setup Open XML SDK 2.5 Please install the .NET Framework and run this setup again. The .NET Framework can be obtained from the web. Would you

OpenXml: Determining the Image in a Cell in Excel [duplicate]

别说谁变了你拦得住时间么 提交于 2019-12-20 03:21:58
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to check if a cell has a picture? OpenXML: Excel, extracting Cell text and Image/Picture data I have An Excel document with 4 images, each in a cell A1,A2,A3,A4 I can iterate thru all the images in the worksheet, but I need to be able to edit this function to give me the image in "A1" and "A2" for instance [Test] public void IterateThruImages() { WorkbookPart wbPart = document.WorkbookPart; var workSheet =

Defining a table rather than a range as a PivotTable 'cacheSource'

梦想与她 提交于 2019-12-20 02:34:43
问题 I am building a tool to automate the creation of an Excel workbook that contains a table and an associated PivotTable. The table structure is on one sheet, the data for which will be pulled from a database using another tool at a later point. The PivotTable is on a second sheet using the table from the previous sheet as the source. I am using EPPlus to facilitate building the tool but am running into problems specifying the cacheSource . I am using the following to create the range and

Using OpenXML to save a PowerPoint presentation as a PDF

99封情书 提交于 2019-12-20 02:29:37
问题 My objective is to make an automated server-side process to turn a .ppt into a .pdf . Microsoft themselves suggested that I use OpenXML, and now I'm looking at that. My question is: Can I actually achieve my objective using OpenXML? I'm having a hard time finding the methods that I'd expect, such as "save as" here Or perhaps I'm just misunderstanding how it all works? 回答1: ... to turn a .ppt into a .pdf. Microsoft themselves suggested that I use OpenXML ... Can I actually achieve my objective

OpenXML replace specific customxml part of word document

天涯浪子 提交于 2019-12-20 02:17:36
问题 I am using OpenXML SDK ver 2 to manipulate some word documents. The documents currently have custom xml parts and what I want to do is replace the xml for the parts specifically. I know I can do something like this to access the customxml parts of a document: Dim mainStream As New MemoryStream() Dim buffer As Byte() = File.ReadAllBytes(Server.MapPath("myfile.docx")) mainStream.Write(buffer, 0, buffer.Length) Try Using mainDocument As WordprocessingDocument = WordprocessingDocument.Open

How to keep style on open xml documents

隐身守侯 提交于 2019-12-19 03:58:10
问题 I am using open XML(Microsoft Word - .docx) as a file template to automatically generate other documents. In the template document I have defined content controls, and I have written code to replace content in these content controls. The content is replaced and the documents are generated, but I am struggling with keeping the style. In Word, when inspecting properties of the content control, I have checked the checbox for "Use a style to format text into the empty control: style", and also

Extract table from DOCX

三世轮回 提交于 2019-12-19 03:16:56
问题 I have one problem with parsing *.docx document with OpenXML (C#). So, here's my steps: 1. Load *.docx document 2. Recieve list of paragraphs 3. In each paragraph look for text,image and table elements 4. For each text and image element create html tags 5. Save output as *.html file I've found out how to locate image file in document and extract it. Now there's one step to go - find where is table position in text (paragraph). If any one know how to locate table in *.docx document using

Extract table from DOCX

血红的双手。 提交于 2019-12-19 03:16:10
问题 I have one problem with parsing *.docx document with OpenXML (C#). So, here's my steps: 1. Load *.docx document 2. Recieve list of paragraphs 3. In each paragraph look for text,image and table elements 4. For each text and image element create html tags 5. Save output as *.html file I've found out how to locate image file in document and extract it. Now there's one step to go - find where is table position in text (paragraph). If any one know how to locate table in *.docx document using