openxml

Best place for unique ID in DOCX (Open XML WordprocessingDocument)

Hi, I am looking for a way to indentify DOCX files if they are moved or renamed. Reason is obvious, I am playing with the Open XML SDK, building a hyperlink checker. Works perfect, at least it can add or update hyperlinks in a document. Problem is, though, if I rename an external file (source.docx + target.docx to targetB.docx) the lin...

Why does T-SQL OpenXML bust with certain characters?

I have the following XML that I'm running in SQL Server, and it breaks, why? declare @xml varchar(max) declare @hDoc int set @xml = '<transaction> <item itemId="1" value="Hello World" /> <item itemId="2" value="Hello &World" /> <item itemId="3" value="Hello <World" /> <item itemId="4" value="Hello >World" /> <item itemId="5" va...

Create custom shape or connector in PowerPoint using code/script/definition

The shapes in in PowerPoint 2007 seem to be built in - is there a way to create 'user'/'custom' shapes? I wanted to create a custom connector, but knowing if you can create a custom shape, could be handy in the future. ...

Open XML Spreadsheet style error

I've used the Open XML Format SDK 2.0 to create a simple excel document. Opening the document in Excel first requires Excel to open it. I've narrowed this down to the CellFormats within the Stylesheet. The contents of which are below: <x:styleSheet xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"&gt; <x:numFmts coun...

Mail Merge using the Open XML SDK

Hullo! Right, lets say I have a DataTable with 3 columns (a,b,c) and a docx file with the corresponding MailMerge fields set up. What I'd like to do is perform a Mail Merge on the document with the data. Presume that you can write to the hard disk (if you need to create a csv etc for doing the merge etc), you don't have word, excel etc...

Create PowerPoint 2007 presentation from a template

Hi, I need to create a PowerPoint 2007 presentation from a template with Open XML Format SDK 2.0. The template has to be provided by the customer and is used for a individual layout style (font, background color or image,...). It needs to contain two predefined slides: Text slide Image slide The application should now create a copy ...

What would happen if an error occured in bulk Xmlinsert.

If there is an error in XMLbulk insert, would all the data would rollback if the bulk insert is in transaction ...

How to accurately determine if an SPFile instance is a converted file?

I have been working on a document conversion feature for converting a docx file to a pdf file using MOSS 2007. The SPFile.Convert() call is being made in the ItemAdded event and the ItemFileConverted event is fired fine as well. The eventing seems to be working fine, but the IsConvertedFile and SourceLeafName properties of the converte...

How to insert line break within OPENXML spreadsheet cell ?

Hi, im currently using something like this to insert inline string in a cell : new Cell() { CellReference = "E2", StyleIndex = (UInt32Value)4U, DataType = CellValues.InlineString, InlineString = new InlineString(new Text( "some text")) } But \n doesn't work to insert line break, how can i do this ? Thanks Th...

Programmatically Reading _AssemblyLocation From a VSTO Excel Workbook

I've got a Visual Studio Excel Workbook project. When I publish the workbook and examine the source of the workbook (I open WinZip and check custom.xml), I see the tag _AssemblyLocation, which corresponds to the publish path. Is there a way to read _AssemblyLocation from my .NET code? I'd like to be able to read the publish path and de...

OpenXML SDK Spreadsheet starter kits

I am trying to start working with excel documents through the OpenXML SDK Spreadsheet API. But I havent found any good guides or even examples on how to create a xlsx file from scratch. Only how to open an existing document and modify it. I have been thinking on having a empty template document and make a copy of it an then begin my pro...

What are some techniques for generating PowerPoint presentations without using Office Automation?

While it is possible to generate PowerPoint presentations automatically using Office Automation, this is not recommended for use on a server. How can you go about generating a PowerPoint presentation without using Office Automation? ...

OpenXml File Format Design and Best Practices

Folks, We have been using OpenXml APIs found in System.IO.Packaging for creating a package file that contains some Xml/Binary files, hence the package is some how structured as below: Package/ -/DataFolder1/an xml file.xml -/DataFolder2/another xml file.xml -/Bin/other binar files This has been used for version 1.0 of the applicat...

OpenXml Sdk

Hi I've asked on the OpenXml Sdk forum but that place seems about as active... not very active. I'm doing some server side excel output using the OpenXML Sdk v2 ctp. Has anyone here had any experience using this - mpre specifically: Is there a way to add subtotals to data in a spreadsheet using the SDK? or do i need to manually iterate...

Delphi "DOMVendor" Open XML and Xerces: known limitations?

Is it safe to use Open XML instead of MSXML as the DOM Vendor with Delphi's IXMLDocument interface? Are there known limitations in basic functionality which I should be aware of? And how do the Open XML and Xerces implementations differ? (Xerces needs additional libraries, while Open XML seems to be included in the executable iirc) ...

How do I overcome OpenXML's 8000 character limit?

I'm loading an XML in SQL using OpenXML while declaring the variable the max i can go up to is 8000 chars : DECLARE @xml_text varchar(8000) Since text, ntext is not allowed to be used with openXML what other alternatives do i have to load the entire XML (over 20000 chars) in SQL ? ...

Generating a Word Document with C#

Given a list of mailing addresses, I need to open an existing Word document, which is formatted for printing labels, and then insert each address into a different cell of the table. The current solution opens the Word application and moves the cursor to insert the text. However, after reading about the security issues and problems associ...

How can I insert OpenXML-Word files into another document programmatically in Word 2003

Hi, I need to insert an OpenXML Word document into another document in Word 2003 inside a VSTO 2005 customization. With the old WordML (2003) documents I used Selection.InsertXML() for this, but OpenXML or the flat XML format (Flat OPC) of it does not work with this method in Word 2003 even if the compatiblity pack is installed (no su...

Creating Excel document with OpenXml sdk 2.0

I have created an Excel document using OpenXml SDK 2.0, now I have to style It, but I can`t. I don't know how to paint the background color or change the font size in different cells. My code to create a cell is: private static Cell CreateTextCell(string header, string text, UInt32Value index) { Cell c = new Cell(); c.DataTyp...

Sending an email attachment in memory using OpenXML

I've got an Excel file that's built using OpenXML 2 and I want to send it as an email attachment. e.g. System.IO.MemoryStream stream = new System.IO.MemoryStream(); SpreadsheetDocument package = SpreadsheetDocument.Create(stream, SpreadsheetDocumentType.Workbook)) AddParts(package); //created using document reflector Savin...