views:

15

answers:

1

project: Using VB.NET to build a winforms database interface and work-automation app.

I am using this editor for the users to enter their text in the database interface environment that will both load/save/show them what they are working on in the form and also mail-merge into a Word document waiting for the content. I can do the first step and it works well, but how do I get MS Word to recognize HTML as formatting instead of just merging in tags and text all as text?

The tool has two relevant properties: one to get just the text (no markup, i.e. no HTML) and one to get the full markup with HTML. Both of these are in text format (which I use for easy storage in the Database).

ideas/directions I can think of:

1) use the clipboard. I can copy/paste the content straight from the editor window to Word and it works great! But loading from a database is significantly different, even when using the clipboard programatically. (maybe I don't understand how to use the clipboard tools)

2) maybe there is a library or class/function in Word that can understand the HTML as "mergable" content?

thanks!

:-Dan

A: 

You may use our (SautinSoft) .Net library to transform each of your HTML data to Word document. Next you may merge all produced Word documents into single Word document. The component also have function to merge Word documents.

This is link download the component: http://www.sautinsoft.com/products/html-to-rtf/download.php

This is a sample code to transform HTML to Word document in memory:

Dim h As New SautinSoft.HtmlToRtf
Dim rtfString As String = ""
rtfString = h.ConvertString(htmlString)

This is a sample code to merge two documents in memory:

Dim h As New SautinSoft.HtmlToRtf
Dim rtfSingle As String = ""
rtfSingle = h.MergeRtfString(rtf1, rtf2)
Maximus