openxml

OpenXml: Copy OpenXmlElement between documents

Hi, I have two Word documents (WordprocessingDocument), and I want to replace the contents of an element in the first with the contents in the body of the second one. This is what I'm doing right now: var docA = WordprocessingDocument.Open(docAPath, true); var docB = WordprocessingDocument.Open(docBPath, true); var containerElement =...

Manipulating Microsoft Word Office 2007 .docx document from PHP

I need an option from within PHP to Manipulate .docx (Microsoft Office 2007) document. I need to: Read the internal text Convert to .html To view them inside a browser. To replace text. I know I can use Word Automation, creating a COM object of Microsoft Word, but it's too slow, unstable and I have to have it installed on the server...

Replace bookmark text in Word file using Open XML SDK

I assume v2.0 is better... they have some nice "how to:..." examples but bookmarks don't seem to act as obviously as say a Table... a bookmark is defined by two XML elements BookmarkStart & BookmarkEnd. We have some templates with text in as bookmarks and we simply want to replace bookmarks with some other text... no weird formatting is ...

Word documents generation with c#

Possible Duplicates: How can a Word document be created in C#? Convert Word doc file to docx on a server without Word Hi everyone ! Using your experiences, i wanna found the better sdk/library to create Word doc/docx, with or without .doc template, but without interop ! Thanks ! kiRbytte ...

Difference between Open and Create on DocumentFormat.OpenXml.Packaging.WordprocessingDocument

The docs for both methods read virtually identical to me. I have a template (.DOTX) which I want to open and make changes to, saving as .DOCX. What's the right approach? And, in fact, how do I save the document? I see no Save method... ...

export XML -> Excel

I'm already generating an excel XML file (.xml) containing 2 worksheets. issue #1: the people downloading the XML file wouldn't know to open the file in Excel. (they'd complain.) solution #1: I rename the file to .XLS instead of .XML. issue #2: when opening the file in Excel i get the this error: The file you are trying to open, ‘...

Is there functionality that is NOT exposed in the OpenXML SDK v2?

I want to know if there is anything that you cannot do with SDK that was exposed in the COM interface? ...

From Excel to DataTable in C# with Open XML

I'm using Visual Studio 2008 and I need create a DataTable from a Excel Sheet using the Open XML SDK 2.0. I need to create it with the DataTable columns with the first row of the sheet and complete it with the rest of values. Does anyone have a example code or a link that can help me to do this? ...

Should I be using an abstract base class for this purpose at this time?

I only very recently began developing professionally. I studied OOP while at University, but don't feel as if I ever really used it in a "real world" scenario. Basically, in trying to create/manipulate a specific type of document within the organization, I created a class for it, with the thinking that anytime we wanted to create/manipu...

How can I embed any file type into Microsoft Word using OpenXml 2.0

I spent a lot of time trying to figure out a good way to embed any file into Microsoft Word using OpenXml 2.0; Office documents are fairly easy but what about other file types such as PDF, TXT, GIF, JPG, HTML, etc.... What is a good way to get this to work for any file type, in C#? ...

what exactly does the SDK v2 take care of that you would have to do manually when coding by hand with an XML library?

This is closely related to another question I asked: Is there functionality that is NOT exposed in the OpenXML SDK v2? I am currently working with OpenXML files manually. I recently had a look at the SDK and was surprised to find that it looked pretty low level, quite similar in fact to the helper classes I have created myself. My quest...

Microsoft Office Word 2007 .docx manipulation via software C++ / Javs SDK

Hi, I am looking for a C++ / Java SDK for manipulating .docx documents. I need to read the text, add a new page at the beginning, add footer and header etc'. Not one that works with COM / OLE Automation for Word. But a real SDK. Thanks ...

Automated Testing OpenXML SDK

Hi, I'm implementing ms word document generation using content controls and OpenXML SDK. I'd like to have some automated testing for that code (unit tests or some easy UI automation tests). Does anyone has expericnce with testing MS Word document generation? What are the possible options? Thanks in advance! ...

OpenXML: Allow editing of Content Controls in locked Word document

I want to create a Word document that works as a template, where all the document is locked from editing except the Content Controls (<sdt/> elements) in the document that the user can edit. What I've seen is that if I lock the document edition (right now I'm using the _markAsFinal property) there's no way to unlock a single Content Con...

How do I write a Microsoft Word/Office Open XML document using Perl?

I have written a Perl script that reads some data and generates an OpenOffice Writer/OpenDocument file for that data. Can I also construct a Microsoft Word/Office Open XML document? ...

Speed Up OpenXML retrieving values

I am using the example from http://msdn.microsoft.com/en-us/library/bb332058(v=office.12).aspx to retrieve values from an excel file. I am retrieving about 1500 values, and it is very slow. My question does anyone know a better way to retrieve values quickly out of an excel file? One thing that did save about 6 seconds was not opening...

XQuery vs OpenXML in SQL Server

I have this XML in a SQL Server table: <root> <meetings> <meeting> <id>111</id> <participants> <participant><name>Smith</name></participant> <participant><name>Jones</name></participant> <participant><name>Brown</name></participant> </participants> </meeting> <meeting> <id>22...

How to use OPENXML to load XML data into existing SQL Table?

I am a newbie to OPENXML. But I am trying to load a .XML file into a SQL table that I created for this. I do not receive any errors with this code, but it doesn't insert any records either. This is the table I created in 2008 SQL Server: CREATE TABLE HOMEROOM( HOMEROOM_TEACHER INT, HOMEROOM_NUMBER INT, ENTITY_ID INT) And this is th...

OpenXML: Creating reusable Content Controls with binding

I need to attach specific XML to a word document so the elements will show up in the right places. This I can do with OpenXML SDK. The thing is I want too be able to define the Content Controls already bounded in some sort of template so other people can create the real document template the xml will be attached to. Ok not sure people w...

Help me improve a OpenXML linq-to-xml query!

Guess people need some experience with Linq-to-xml and knowledge of the build of a openXML word document. I have this Linq to XML query that's supposed to find Content Controls. It works most of the time but I think it's still just juryrigged and not proper. How it works, if I understand correctly, is that it checks StdRuns and finds i...