Friday, July 09, 2004

Office Developer Center: Use ASP.NET or Visual Basic.NET to Transform XML to RTF and Display in Word

Office Developer Center: Use ASP.NET or Visual Basic.NET to Transform XML to RTF and Display in Word

"Learn different ways of converting XML data to RTF. XML is a flexible way of organizing and presenting data. RTF is a text-based format that encodes formatted text, document layout, and graphics. Converting XML data to RTF allows you to create useful documents easily and quickly from a wide variety of data sources.

This article demonstrates how to generate Rich Text Format (RTF) from Extensible Markup Language (XML) by using Microsoft Visual Basic .NET. Rich Text Format is a text-based format that encodes formatted text, document layout, and graphics. It is commonly used with word processors such as Microsoft Office Word 2003. Because RTF is text-based, you can easily generate it with code. If you have XML data that you want to display in Word such as a catalog, list or mail-merge document, then transforming your XML data into an RTF stream might be an ideal solution for you. And, in fact, if you are developing a solution where you generate documents on a Web server, then generating those documents using a text-based format, such as HTML or RTF, is preferred over using server-side automation of Word.

This article provides code, with step-by-step instructions, to transform XML into RTF for display in Word by using various approaches:

* Save the RTF to a file and open it in Word.
* Transfer the RTF to Word by using the Windows Clipboard.
* Stream the RTF to Word hosted in Microsoft Internet Explorer from an ASP.NET Web Application using a simple and then a more complex transformation.
"

Oh I can use this...

No comments:

Post a Comment

NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...

ALL comments are moderated. I will review every comment before it will appear on the blog.

Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...

I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...

Please see my comment policy for more information if you are interested.

Thanks,
Greg

PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...