tags:

views:

248

answers:

1

I have a requirement to move the html text available in a string builder to a word document and open the word document after the data is appended in a VB.NET console application. I am new to console applications and am not sure how this could be done, but I am aware that if I am using a Web Application then I can use the following code:

Response.AppendHeader("Content-Type", "application/msword")

Response.AppendHeader("Content-disposition", "attachment; filename=myword.doc")

Response.Write(String Builder Variable)

Can some help me with the code please....???

+1  A: 

Write it to a '.doc' file and use ShellExecute to call 'open' on it.

Noon Silk
No firstly the below code is not working in the console application. It is applicable only for the web application.Response.AppendHeader("Content-Type", "application/msword")Response.AppendHeader("Content-disposition", "attachment; filename=myword.doc")Response.Write(String Builder Variable)
1 Write the contents of the string builder to file with the suffix .doc. It should work.
Dan Sydner
Any idea how do I do that please, I am completely new to this???