openxml-sdk

OPEN XML add custom not visible data to paragraph/table

喜你入骨 提交于 2019-12-22 09:07:41
问题 Is there a way to store additional data for a paragraph, that would be persisted after user opens and saves a document in MS Word. Ive been using CusotmXML for this, but it turns out that this is no logner possible due to the fact that MS-Word strips all CusotmXML elements from the document structure. Every single paragraph or a table has an ID that I would like to "pair back" to my data-source. So later when I read the docx again I can identify origins of every unchanged paragraph/table in

Save PowerPoint 2007 as PowerPoint 2003 using Open Office SDK 2.0

左心房为你撑大大i 提交于 2019-12-22 07:08:44
问题 Is there anyway to use the Open Office SDK 2.0 to save a PowerPoint presention that you created using OOXML to a PowerPoint 2003 presentation? I know if you open a 2007 file and click Save As you have the option to save it as a PowerPoint 97 to 2003 document and I didn't know if I could do this grammatically using this SDK. The reason I am asking this question is because I need to give the user the option to save data on a website in either Office 2007 or 2003 format. I much rather just use

How to get all merge fields of word document using open xml sdk

雨燕双飞 提交于 2019-12-22 06:57:17
问题 I am beginner to open xml sdk. I am trying to find out all merge fields of document. But I am not getting the headers and footers merge fields. Can any one suggest a working solution? I am trying some thing like this - foreach (FieldCode field in docGenerated.MainDocumentPart.RootElement.Descendants<FieldCode>()) { String fieldText = field.Text; if (fieldText.StartsWith(" MERGEFIELD")) { Int32 endMerge = fieldText.IndexOf("\\"); Int32 fieldNameLength = fieldText.Length - endMerge; String

XLSX- how to get rid of the default namespace prefix x:?

我是研究僧i 提交于 2019-12-22 04:39:15
问题 I'm generating XLSX spreadsheet using OOXML SDK, and I need to get rid of x: namespace prefix. How can I achieve this? using (SpreadsheetDocument doc = SpreadsheetDocument.Open("template.xlsx", true)) { //Save the shared string table part if (doc.WorkbookPart.GetPartsOfType().Count() > 0) { SharedStringTablePart shareStringPart = doc.WorkbookPart.GetPartsOfType().First(); shareStringPart.SharedStringTable.Save(); } //Save the workbook doc.WorkbookPart.Workbook.Save(); } Here, the original

Link to Microsoft Open XML SDK tutorials [closed]

时间秒杀一切 提交于 2019-12-22 04:22:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Anyone know any link to a good Microsoft Open XML tutorials? 回答1: This is the official place to learn about Open XML: http://msdn.microsoft.com/en-us/office/bb265236.aspx. You can just skim through all results in msdn.microsoft.com for Open XML SDK 回答2: Here are some other links to get your started: http:/

Using a template with OpenXML and SAX

佐手、 提交于 2019-12-21 19:39:36
问题 I'm creating a large XLSX file from a datatable, using the SAX method proposed in Parsing and Reading Large Excel Files with the Open XML SDK. I'm using an XLSX file as a template. The method described in that post works fine to substitute a new sheet in for an existing one, but I want to copy the header row from the sheet in the template (string values, formatting, etc), instead of just using the header row from the datatable as the original code does. I've tried the code below, but the XLSX

How can I get the Worksheetpart from name or sheet ID in OpenXML?

℡╲_俬逩灬. 提交于 2019-12-21 12:49:09
问题 The following creates an XLSX, adds two worksheets with some data. I then want to be able to get the spreadsheet later based on name (or preferably the id) so I can add/modify the sheets at a later point in time. I'm stuck on how to get the sheet again where the code is incomplete below. Sub Main() Using doc As SpreadsheetDocument = SpreadsheetDocument.Create(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "c:\temp\fubar.xlsx"), SpreadsheetDocumentType.Workbook) Dim currSheet As

How to insert a shape in a powerpoint slide using OpenXML

女生的网名这么多〃 提交于 2019-12-21 07:26:17
问题 This question could seem rather basic, but how do I insert a shape (i. e. a rectangle) in a slide using OpenXML in c#? I've searched around and all I see is "create a slide with the shape and use the SDK Productivity Tool to reflect the code. That's not really helpful :( 回答1: After hitting my head against the wall for a while, finally I took the advice, created a slide with the shape and used the tool to reflect the code. So for next generations, here is a brief explanation of how to do it by

Open XML SDK - Adding a macro programatically to a Word 2007 document

核能气质少年 提交于 2019-12-21 05:24:10
问题 I am trying to dynamically add a new custom ribbon in a Word 2007 document following teh manual method described in this article :- http://msdn.microsoft.com/en-us/library/aa338202(v=office.12).aspx. The article specifies the following :- a) Create a XML file named customUI.xml which will contain the elements you want to display in the tab and put the same in a folder named customUI. b) Rename your Word 2007 document to .zip. Add the above "customUI" folder to the zip file. c) Add the

Descendants<T> gets zero elements in Word doc

久未见 提交于 2019-12-20 04:49:37
问题 I am having trouble updating a Hyperlink in a Word doc (Q How to update the body and a hyperlink in a Word doc ) and am zooming in on the Descendants<T>() call not working. Here is my code: using DocumentFormat.OpenXml.Packaging; //from NuGet ClosedXML using DocumentFormat.OpenXml.Wordprocessing; //from NuGet ClosedXML WordprocessingDocument doc = WordprocessingDocument.Open(...filename..., true); MainDocumentPart mainPart = doc.MainDocumentPart; IEnumerable<Hyperlink> hLinks = mainPart