Microsoft SDK for Open XML Formats - Office Live Development
Recent update: 2008-3-21

Content Controls, Custom XML, Digital Signatures

1399 byte By JarnoLeikas at 2008-3-7
Hi, I'm not sure if this is exactly the right place to ask this, but here goes. I'm using classes System.IO.Packaging to digitally sign a custom XML part inside a DOCX file. With a simple document everything is OK, I can verify the signature both by using PackageDigitalSignatureManager as ...

How to avoid the Excel prompt window when exporting data to Excel 2007

5292 byte By arifmd2 at 2008-3-6
Hi, I am a Asp.net Developer(web developer), I am using Asp.net 2.0 framework with VB as language in visual studio 2005. I have a dataset that has to be exported and opened with Excel 2007.Main thing is the column header on the excel is not the datatable(dataset) column names, it is dynamically ...

how to convert word to XML on server side automatically?

540 byte By ecihewu at 2008-3-5
Here is my problem: My organization wants to upload word documents from users to the server. On the server side, the word dcoument (enforced with styles) needs to be converted to XML format files. Next, I need to use php to parse the open xml formats files and put the content into the database. ...

Delta Compression for Office 2007 files?

403 byte By Gancev at 2008-3-3
Hi Does anyone have expirience with BDC binary delta compresion on Office 2007 files . How effective is BDC api provided from microsoft or there is some library for that purpose? Thanks ...

Extract complete WordprocessingML document from package instance.

2161 byte By RoccoMastrangelo at 2008-3-1
Hi, If I have an instance of a package, is there a way to extract the complete WordprocessingML xml document fromm it in the form of: - <pkg: package xmlns: pkg=" http://schemas.microsoft.com/office/2006/xmlPackage">+ <pkg: part pkg:name="/_rels/.rels" ...

Extract complete WordprocessingML document from package instance.

2161 byte By RoccoMastrangelo at 2008-2-28
Hi, If I have an instance of a package, is there a way to extract the complete WordprocessingML xml document fromm it in the form of: - <pkg: package xmlns: pkg=" http://schemas.microsoft.com/office/2006/xmlPackage">+ <pkg: part pkg:name="/_rels/.rels" ...

php and open XML?

102 byte By ecihewu at 2008-2-27
Is there any API or sample codes for php to parse Open XML Formats? Your suggestions are appreciated.

How to avoid the Excel prompt window when exporting data to Excel 2007

5292 byte By arifmd2 at 2008-2-26
Hi, I am a Asp.net Developer(web developer), I am using Asp.net 2.0 framework with VB as language in visual studio 2005. I have a dataset that has to be exported and opened with Excel 2007.Main thing is the column header on the excel is not the datatable(dataset) column names, it is dynamically ...

Extract complete WordprocessingML document from package instance.

2161 byte By RoccoMastrangelo at 2008-2-25
Hi, If I have an instance of a package, is there a way to extract the complete WordprocessingML xml document fromm it in the form of: - <pkg: package xmlns: pkg=" http://schemas.microsoft.com/office/2006/xmlPackage">+ <pkg: part pkg:name="/_rels/.rels" ...

Recognising a date format in an worksheet.xml

697 byte By scifigooner at 2008-2-24
I am currently trying to read an excel spreedsheet into an xml model that we have created. I am reading the worksheet.xml fine and I can determine when the value in the cell is in a boolean or string format. I cannot easily however find a programatic way to distinguish between whether a value ...

Inserting custom XML into an open file: Can it be done?

903 byte By ClaySmith at 2008-2-23
I want to insert a custom XML part into an Open XML file. Problem: The file is currently open in Microsoft Excel 2007. Is there any way to do this? Using XML Mapping, I'm generating an XML file that I want to place inside the Open XML file after an event fires (i.e. the user clicks an ...

Add Style Part using Open XML SDK

155 byte By MDLo at 2008-2-22
How can I add a style part to a document created using the 'How to create an Office Open XML Package by using the Open XML Object Model'

How to avoid the Excel prompt window when exporting data to Excel 2007

5292 byte By arifmd2 at 2008-2-22
Hi, I am a Asp.net Developer(web developer), I am using Asp.net 2.0 framework with VB as language in visual studio 2005. I have a dataset that has to be exported and opened with Excel 2007.Main thing is the column header on the excel is not the datatable(dataset) column names, it is dynamically ...

Need to replace CustomXML with new XML from string

1456 byte By D.Jones at 2008-2-21
I want to use a .docx format document as a template, using form controls and CustomXML. What I want to do to create the generated document is to simply replace the CustomXML "item1.xml" with a new bag of XML containing data that I've been passed. It seems as if I should be able to do ...

System.IO.Packaging has different behavior on different computers

4090 byte By Wildert at 2008-2-20
I have multiple vms, all have office 2007 and windows 2003, and I created a simple hello-world C# windows application that makes a package with a single xml file as a package part. On one VM, the package creates a folder structure inside the package according to the URI of the package part that ...

php and open XML?

141 byte By ecihewu at 2008-2-19
<font face=Arial size=2></font> Is there any API or sample codes for php to parse Open XML Formats? Your suggestions are appreciated.

WordProcessing ML : Change Paragraph Cell Font Size, Color, Name

438 byte By DermotFrench at 2008-2-18
Hi does anyone have sample code for changing the font size, color + name in word processing MLI'm currrently using the snippets from http://openxmldeveloper.org/articles/390.aspx (modified a little) with the SDK.However I'm unsure how to change paragraph or cell font (color, name, size).Any ...

Using Package class but storing to SQL Server

2160 byte By D.Jones at 2008-2-17
I've got some .docx files created in Word2007, destined to be stored in SQL Server rather than in a file system. These documents have had controls mapped using the Word2007 Content Control Toolkit. My current code which deals with the file-system version of these documents uses file streams to ...

Why do you use booleans in [WordProcessingDocument|SpreadsheetDocument|PresentationDocument].Ope

1057 byte By Destinati at 2008-2-16
Why do the Open methods of the WordProcessingDocument, SpreadsheetDocument, PresentationDocument take a "readWriteMode" as a boolean? Wouldn't it make far more sense to use something like a System.IO.FileAccess enum? In fact, the OpenXmlPackage.OpenCore function internally converts ...

Add template

407 byte By Pingu22 at 2008-2-15
Hi. I need to insert a template into a docx file programatically. Can anyone help me? I'm new to open XML, I started yesterday. thanks ...

deletepart not working?

733 byte By stevemyu at 2008-2-15
I have a document with 2 image parts with rId1, rId2. After mainDocumentPart.DeletePart(rId2), I see the image2 is gone, the entry to rid2 was removed from document.xml.rels under .res. So the imagepart rId2 is gone. Problem: there is still an entry of rid2 in MainDocumentPart. Question: Why ...

Open XML Object Model question

2084 byte By seba80 at 2008-2-15
hello, I’ve just installed XML Object Model. Personally I think that it is a great API which saves a lot of coding comparing to previously used System.IO.Packaging. I would like to know if it is possible to: a) Get a list all MainDocumentPart's content controls b) Get a single custom xml ...

Where is the image part after add?

2278 byte By tronn at 2008-2-15
I know the part gets added as the file size increases, but opening the document I can't locate it. I'm sure it's something stupid I'm overlloking. Any help appreciated... public void AddImagePart() { try { string document = @"c:\1.docx"; string fileName = ...

how to convert word to XML on server side automatically?

580 byte By ecihewu at 2008-2-15
Here is my problem: My organization wants to upload word documents from users to the server. On the server side, the word dcoument (enforced with styles) needs to be converted to XML format files. Next, I need to use php to parse the open xml formats files and put the content into the ...

Extract complete WordprocessingML document from package instance.

2161 byte By RoccoMastrangelo at 2008-2-14
Hi, If I have an instance of a package, is there a way to extract the complete WordprocessingML xml document fromm it in the form of: - <pkg: package xmlns: pkg=" http://schemas.microsoft.com/office/2006/xmlPackage">+ <pkg: part pkg:name="/_rels/.rels" ...

Continuation text

897 byte By CliveDixon at 2008-2-14
How can I set up, say, a section or a paragraph or table, so that if its content is displayed over more than one page, I can put some kind of contination text at the top of (or in the header of) the second and subsequent pages, e.g. Page 1: blahblah blahblah blahblah blahblah Page 2: ...

How do I untick the Banded Columns (table) option using Open XML?

143 byte By MDLohan at 2008-2-13
by default 'Banded Columns' is checked when you choose a table style. Which xml file and where do you change to uncheck this ?

how can i append one word document to another word document

1343 byte By LucienYang at 2008-2-13
i have two word document right now, i would like to append one document to another. i tried the code on msdn: Code Snippet Public Sub CopyTheme(ByVal fromDocument1 As String, ByVal toDocument2 As String) Dim wordDoc1 As WordprocessingDocument = WordprocessingDocument.Open(fromDocument1, ...

Display cutom xml text in multiple lines inside a Rich text content control in Word 2007.

405 byte By kris_4_forums at 2008-2-12
Hi there, I have custom xml data like below inside item1.xml which is mapped to a richt text content control: <address>Mr.\r\n Kamran King\r\n81 Newgate Street\r\nLondon</address> I inserted "\r\n" for line breaks. How can I display it in multiple lines in side this ...

How to get started with Open XML Formats Programming?

459 byte By Ptan at 2008-2-11
Hello! Does anyone knows where can I find articles or sample code to help me get started with Open XML Formats programming? What I wanted to do is programmatically open multiple Word 2007 (docx) files on the server; perform search and replace text and merge all the opened files into a single ...

Updating word document from xml data

627 byte By sumit381 at 2008-2-10
Hello, I have a Word 07 document that has a few data fields that I have already mapped using the Word 07 Content Control Toolkit. What I want to do is be able to update my xml file with new info and have that change reflect in the Word document when I open it up. Currently, I have to update the ...

Deleting macro''s from document programmaticaly

324 byte By _Pierre_ at 2008-2-10
I see there is no VBAProjectPart ? I want to programmaticaly delete the vbaProject.bin and references to it. So essential removing the macro's from an xslm or docm file. Is this possible, or do I just replace the vbaProject.bin with an empty one. And don't bother in using this sdk. ...

Open XML SDK Word Tables Rows Columns

227 byte By DermotFrench at 2008-2-8
Hi, I'm trying to create a word document, and want to insert tables rows + columns. Is there any good (fully working samples) using either the SDKs or Snippets that anyone can point me to. Thanks

How to get started with Open XML Formats Programming?

459 byte By Ptan at 2008-2-8
Hello! Does anyone knows where can I find articles or sample code to help me get started with Open XML Formats programming? What I wanted to do is programmatically open multiple Word 2007 (docx) files on the server; perform search and replace text and merge all the opened files into a single ...

how can i append one word document to another word document

1343 byte By LucienYang at 2008-2-7
i have two word document right now, i would like to append one document to another. i tried the code on msdn: Code Snippet Public Sub CopyTheme(ByVal fromDocument1 As String, ByVal toDocument2 As String) Dim wordDoc1 As WordprocessingDocument = WordprocessingDocument.Open(fromDocument1, ...

Add Style Part using Open XML SDK

155 byte By MDLo at 2008-2-7
How can I add a style part to a document created using the 'How to create an Office Open XML Package by using the Open XML Object Model'

Need to replace CustomXML with new XML from string

1456 byte By D.Jones at 2008-2-7
I want to use a .docx format document as a template, using form controls and CustomXML. What I want to do to create the generated document is to simply replace the CustomXML "item1.xml" with a new bag of XML containing data that I've been passed. It seems as if I should be able to do ...

Copying ImagePart from one Word doc to the other

1050 byte By vj9999 at 2008-2-7
I can copy image parts without any problems, but the actual media gets written into /media instead of /word/media . Also in the document.xml.rels I getTarget="/media/image.bin" (instead of .gif) for this Relationship. Using the copied image in the doc works just fine, but just for ...

tblpPr and topFromText

1391 byte By CliveDixon at 2008-2-6
I am attempting to put some space between text and a following table using the tblpPr element along with the topFromText attribute, like so: <w:body> <w> <w:r> <w:t>Hello world</w:t> </w:r> </w> <w:tbl> <w:tblPr> <w:tblpPr ...

Updating word document from xml data

627 byte By sumit381 at 2008-2-6
Hello, I have a Word 07 document that has a few data fields that I have already mapped using the Word 07 Content Control Toolkit. What I want to do is be able to update my xml file with new info and have that change reflect in the Word document when I open it up. Currently, I have to update the ...

Modify an openxml Excel file

1200 byte By mathmax at 2008-2-5
Hello, I've a problem to modify a sheet in my Excel document. All the files present in the package are removed when I execute this code : Package pkgOutputDoc = Package.Open(fileName, FileMode.Create, FileAccess.ReadWrite); Uri uri = new ...

Calculate pixel width/height for row/col width/height?

719 byte By CompMan86 at 2008-2-5
I'm trying to write an AutoFit function to automatically set the height of a row or the width of a column. For instance, if I call AutoFitWidth on column 3, it will loop through all the cells in column 3 and set the column width to the maximum necessary width to avoid spillover. To do this, ...

Delta Compression for Office 2007 files?

403 byte By Gancev at 2008-2-4
Hi Does anyone have expirience with BDC binary delta compresion on Office 2007 files . How effective is BDC api provided from microsoft or there is some library for that purpose? Thanks ...

Inserting HTML into a new Word 2007 Document

323 byte By David(S) at 2008-2-4
Hi All, Im new to the SDK and Open XML format, and I'm having some trouble figuring out how to store raw html (in my application this value will be retrieved from a HtmlEditor textbox), into my word document. If i just paste as is, all the tags etc show up in the word document. Thanks David ...

Custom XML preserved thru cut/paste operations

606 byte By Ed9999 at 2008-2-4
Not exactly a SDK question, but here goes: We have a document with inline custom xml markup to tag specific portions of the doc. In Word 2007, if we cut/paste those sections into a new document, it doesn't seem to preserve the custom markup. Cutting/pasting within the same document works. ...

validating xmlfile with xsd

765 byte By blastthexml at 2008-2-4
iam validating xml file with xsd using XmlValidatingReader in that it is validating successfully. But the problem is it is showing same error for all the validation errors that is "element has an invalid value according to its data type" . Now the problem is i want to know that what ...

xml validating

507 byte By blastthexml at 2008-2-3
How to validate each text contained in the xml file against the xsdfile i.e the data type each text should be correct as well as to checkeach required attribute is present or not. and throw what type of validation error is occured in validation . can anybody suggest me thesolution plz send me ...

validating xmlfile with xsd

765 byte By blastthexml at 2008-2-3
iam validating xml file with xsd using XmlValidatingReader in that it is validating successfully. But the problem is it is showing same error for all the validation errors that is "element has an invalid value according to its data type" . Now the problem is i want to know that what ...

WordprocessingML page break: forcing an *odd* page number?

789 byte By solmyr72 at 2008-2-2
Hi, Using WordprocessingML, I'd like to insert a *page break*, but there's a twist: The new content must start on an *odd* page number, inserting an empty page if neccessary (the motivation being: I print the document on both sides of the paper, and it's nicer if every new chapter starts on ...

xml validating

507 byte By blastthexml at 2008-2-2
How to validate each text contained in the xml file against the xsdfile i.e the data type each text should be correct as well as to checkeach required attribute is present or not. and throw what type of validation error is occured in validation . can anybody suggest me thesolution plz send me ...