View Single Post
  #1 (permalink)  
Old January 11th, 2008, 05:59 PM
Itech Itech is offline
Registered User
 
Join Date: Nov 2007
Location: Chicago, IL, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default export asp.net page to ms word and embed images

Hello All,

I am using this code snippet to export the contents of my asp.net page to an ms word doc giving the user the option to "Open", "Save", "Cancel".

            Response.ClearHeaders();
            Response.Clear(); //this clears the Response of any headers or previous output
            Response.Buffer = true; //make sure that the entire output is rendered simultaneously
                    Response.ContentType = "application/msword";
                    Response.AddHeader("Content-Disposition", "attachment; filename=" + _ProjDocEntity.DocTitle + ".doc");

anyhow, when i do a local save of the created word doc, the pictures within the word doc(outputted html) are simply image references to the location of it on the web server. well, i need to create this word doc and instead of having the images as references, i need them to be embedded into the word doc the same as if i were to issue a "Insert Picture" from within ms word.

Do any of you know how to export an asp.net page into ms word and have the images embedded into the file so that the contents of the ms word doc are completely disconnected from any references to any external resources i.e. <img refs etc.?

thanks in advance.