Monday, January 28, 2008

Convert Xmlmessage to Word 2007 Format (OOXML)

While I was doing some research on custom pipeline components, I came accross an example of a sendpipeline that encodes a message to the new Open Format OOXML of Word 2007.
You can download the sample here: CreateOOXMLPackage.zip

Just build the solution, and add the Pipeline dll to the "C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components" folder and also to the GAC.
Add a Reference from the BizTalkProject to the pipeline.
Deploy the BizTalkProject with the appropiate properties.

In the BizTalkAdministration Tool, create a Receive and a Send Port, both using the FILE-adapter. Set the Send Pipeline to "CreateOOXMLPackage" and configure the destination filename to be something like "documentname.docx".
Also set a filter on the Send Port to subscribe to the Receive Port.
And configure the Outbound Maps to use SalesReport_to_WordMLSalesReport.

Now drop a testfile into the Receive Location and let the pipeline work its magic!

Credit goes to Nick Heppleston and his BLOG.

No comments: