openxml

How can I search a word in a Word 2007 .docx file?

不羁的心 提交于 2019-12-17 03:24:15
问题 I'd like to search a Word 2007 file (.docx) for a text string, e.g., "some special phrase" that could/would be found from a search within Word. Is there a way from Python to see the text? I have no interest in formatting - I just want to classify documents as having or not having "some special phrase". 回答1: More exactly, a .docx document is a Zip archive in OpenXML format: you have first to uncompress it. I downloaded a sample (Google: some search term filetype:docx ) and after unzipping I

How can I enable the “Sharing” options on Excel workbooks?

跟風遠走 提交于 2019-12-14 03:59:54
问题 Is it possible to enable "Sharing" on excel documents through OpenXML or ClosedXML? Or any other library if it can help... I believe this is usually performed when you save the document (at least that's how it works in VBA), but I can't find how to specify saving arguments in C#. I'd like to avoid using InterOp since I might batch this process on multiple files through a network. EDIT: According to some old pages from 2009, there are limitations where OpenXML cannot operate protected files.

How to apply font and color on text in cells of Excel file using openxml

隐身守侯 提交于 2019-12-14 03:56:44
问题 I am new in Openxml. I am trying to create a xlsx file using openxml. I want to apply different font and color to the text of different cells in excel file. I am using this for creating a xlsx file but not able to do the font and color part. SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Create("E:\\Word9.xlsx", SpreadsheetDocumentType.Workbook); WorkbookPart workbookpart = spreadsheetDocument.AddWorkbookPart(); workbookpart.Workbook = new Workbook(); WorksheetPart

How to Generate DataXML in OpenXML for powerpoint in java

心已入冬 提交于 2019-12-14 02:49:42
问题 I have added one smart art shape in the Microsoft power point presentation slide. I have retrieved the data of that diagram in Java using apache POI. I want to generate my Own DataXML for that presentation from scratch using apache poi or any other free java API. How i can generate that DataXML. Presentation consists of hierarchy smart art object only . Following is the XML from which i want to generate the Data XML. <cds> <parent name="Hierarchy Parent"> <child id="1" name="Child 1"/> <child

How to get python-docx working with complex scripts?

泄露秘密 提交于 2019-12-14 02:24:31
问题 I have a working docx generator which works fine for European languages, and I'm trying to add complex script support. I found another question with some recipes to try: python-docx add_style with CTL (Complex text layout) language I managed to get it working so that complex-script text comes out in the correct typeface and size, but I can't get bidirectional (right-to-left) text working. The obvious "x.font.rtl = True" doesn't work, and neither does the spell given in the other post ("lang

Read/import existing Excel file programmatically (cell-by-cell) in Windows Phone 8

冷暖自知 提交于 2019-12-14 01:31:18
问题 I am working on a Windows Phone 8 app to READ/WRITE Excel files. I asked a question here about this and the comment provided and many other links led me to OpenXml. All of this got me good on how to create an Excel file and how to launch it. But now I am stuck at very basic of these all i.e. How to read an existing Excel file (probably created outside using MS Excel) cell-by-cell i.e. I want to access each cells and their values through my code. In the openXML thing I did this: Stream

Converting docx to pdf using openxml and pdfcreator in c#

六眼飞鱼酱① 提交于 2019-12-14 00:27:45
问题 I need to convert docx to pdf file in server. I have seen PDFCreator will do, based on below link(http://sourceforge.net/projects/pdfcreator/). I need some suggestions on this as listed below: can i use PDF Creator in server side. without creating word object, can i convert docx to pdf with openxml by using pdfcreator API. Please give me reply soon. 回答1: You can use docx4j.NET to convert a docx to XSL FO, and from there, to PDF. Or, indeed, to any of the other output formats supported by

Word Breaks in text extraction , Lxml Xpath

时间秒杀一切 提交于 2019-12-13 18:32:37
问题 I want to extract words with strikethroughs i.e with the <w:delText> tag. I have used an expression and it extracts it successfully except that some words appear broken . For example the word "They" appears as 'T' and 'hey' . Given below is an xml sample where the problem persists: <w:delText xml:space="preserve">. </w:delText></w:r><w:r w:rsidR="0020338C" w:rsidDel="00147CFE"><w:rPr><w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman"/><w:sz w:val="24"/></w:rPr><w:delText>T</w

Perform find & replace in excel doc in C#

梦想的初衷 提交于 2019-12-13 16:45:22
问题 I am trying to create a postage label that is populated dynamically in C#. What I thought I could do was create the label in Excel so I could get the layout perfect, then use OpenXML to replace the fields. i.e. I have fields called things like XXAddressLine1XX , where I want to edit the XML and replace that text with the actual Address Line 1 from the database. Has anyone actually done something similar to this before and could post some code up that I could try? I've used OpenXML to do this

Update TOC in .docx document using DocumentFormat.OpenXml (C#)

℡╲_俬逩灬. 提交于 2019-12-13 15:19:01
问题 I create new word document using DocumentFormat.OpenXml. I load template document in which located the table of content and the table with picture logo. I append other content using c# code for this template. I send this document to user. When user get this document and open it - the table of contents not update. I found the resolve this problem. I add to my code mainPart.DocumentSettingsPart.Settings.Append(new UpdateFieldsOnOpen() { Val = true }); But when user will get the document and