openxml

Word OpenXML . Traversing OpenXmlElements between bookmarks

拈花ヽ惹草 提交于 2019-12-10 17:14:09
问题 I need to traverse nodes between a bookmark start and a bookmark end tag. The problem appears to break down into a tree traversal but I am having trouble pinning down the correct algorithm. The bookmark start and end elements are non-composite nodes (no children) and may appear at an arbitrary depth in the tree. Bookmark start are also not guaranteed to be a at the same depth. If you draw the tree structure for the document I would want to examine all nodes between the start and end bookmark.

Convert Open XML Excel files to HTML

。_饼干妹妹 提交于 2019-12-10 17:06:48
问题 I'm developing printing solution for MS Office 2007. Office automation is not right for me, because it requires Office to be installed. Open XML Document Viewer is solution for converting Word files (.docx) to HTML format by XSLT transform, but it works only for .docx. Can the same technology be used for Excel spreadsheets files? 回答1: You could use this article XSL transformation of SpreadsheetML to HTML as a starting point to develop your own transform. You can also look at the open source

Programmatically save as PowerPoint 2007 (pptx), from PowerPoint 2003

痞子三分冷 提交于 2019-12-10 16:34:31
问题 I need to be able to save Presentations (programatically) in PowerPoint 2003 as OpenXML (".pptx"). I installed the Microsoft Office Compatibility Pack. This indeed allows me to perform "Save as PowerPoint 2007 Presentation" from PowerPoint 2003. How can I do this programmatically? (e.g. VBA) I tried Presentation.SaveAs : While there is no inherent PpSaveAsFileType enum value in PowerPoint 2003 for ppSaveAsOpenXMLPresentation , I made a program which prints the PpSaveAsFileType values and

How do I hide columns in OpenXML spreadsheet using C#?

天涯浪子 提交于 2019-12-10 16:28:14
问题 I'm using DocumentFormat.OpenXML with C#. How do I hide specific columns? Some part of the code: using (SpreadsheetDocument sDocument = SpreadsheetDocument.Open(resultFileName, true)) { WorkbookPart workbookPart = sDocument.WorkbookPart; WorksheetPart worksheetPart = workbookPart.AddNewPart<WorksheetPart>(); var relId = workbookPart.GetIdOfPart(worksheetPart); GenerateWorksheetPartContent(worksheetPart, data, templateSheet); var columns = worksheetPart.Worksheet.Descendants<Column>(); <--

After updating a cell and save excel, formulas based on this cell doesnt recalculate

六月ゝ 毕业季﹏ 提交于 2019-12-10 16:24:10
问题 Hi, Im using XML SDK to update some cells on an excel file. This is the code that im using to update a cell for a given text (and its working fine). WorksheetPart worksheetPart = GetWorksheetPartByName(spreadSheet, sheetname); spreadSheet.WorkbookPart.Workbook.CalculationProperties.ForceFullCalculation = true; spreadSheet.WorkbookPart.Workbook.CalculationProperties.FullCalculationOnLoad = true; if (worksheetPart != null) { Cell cell = GetCell(worksheetPart.Worksheet, columnName, rowIndex);

Open protected word document with OpenXML

我怕爱的太早我们不能终老 提交于 2019-12-10 16:17:06
问题 I have searched every where but, I can't found any answer. All posts and discussions are about creating protected one but nothing for open it. I have protected DOCX and DOC documents in my c# program and want to open them programmatically using OpenXML 2.5. I have opened them using Office interlope as it has password parameter. But it's very slow with large documents number. Can i open password protected word documents using OpenXml ? How ? Thanks. 回答1: Password protected documents (documents

Why is Cell.CellReference optional? How do I get cell location otherwise?

爷,独闯天下 提交于 2019-12-10 14:05:51
问题 According to the OpenXml spec CellReference is optional. But is there an alternative way to get a cell's location? For example, I can get a row's cells by something like: foreach (Row r in sheetData.Elements<Row>()) { foreach (Cell c in r.Elements<Cell>()) { Console.WriteLine(c.CellReference); } } But without CellReference, how do I know the cells' locations? I have done some research and all solutions seem to rely on comparing a cell's CellReference against a given string. 回答1: The

How do I get OpenXML onto the clipboard so that it will paste into Excel?

爱⌒轻易说出口 提交于 2019-12-10 14:05:09
问题 I am generating OpenXml using the DocumentFormat.OpenXML library from Microsoft. I am tring to figure out how to get this document into my clipboard so that I can paste my data into Excel (as if it were copied from Excel). I am able to see OpenXml formated data coming out of Excel, when I copy from within Excel. I need to do the reverse, copy out of a WPF application, and paste into Excel using advanced Excel formatting (hence needing OpenXML). Here is a snippet of what I have so far:

Save WordprocessingMLPackage to ByteArrayInputStream

眉间皱痕 提交于 2019-12-10 13:58:29
问题 How can I save a org.docx4j.openpackaging.packages.WordprocessingMLPackage instance into ByteArrayInputStream, then It can be downloaded from server. Thanks. 回答1: You cannot save to a ByteArrayInputStream ... ever. A ByteArrayInputStream is an InputStream and you don't / can't write to an InputStream . However you can write something to a ByteArrayOutputStream , get the byte array, and create a ByteArrayInputStream wrapper for the array. (I'm assuming that there is a way to save one of those

Excel “Refresh All” with OpenXML

*爱你&永不变心* 提交于 2019-12-10 13:14:12
问题 I have an excel 2007 file (OpenXML format) with a connection to an xml file. This connection generates an excel table and pivot charts. I am trying to find a way with OpenXML SDK v2 to do the same as the "Refresh All" button in Excel. So that I could automatically update my file as soon as a new xml file is provided. Thank you. 回答1: You can't do this with Open XML. Open XML allows you to work with the data stored in the file and change the data and formulas and definitions and such. It doesn