Visual Studio .NET - Export from Web Page to Word (Include Images)

Asked By rik butcher on 21-Dec-05 10:02 AM
guys, ive put a repeater control & an asp.net image control in a panel and all exports to word except for the actual image. its just a red 'x' - similiar to when an html page cant find an image.
is there something special i need to do to get this to work? 
is the problem using the stringWriter class maybe?
exporting data to word or excel seems to be relatively easy, but images have me stumped.
any help is definately appreciated. thanks 
rik
code is Below:


Private Sub exportMeWord()
Try
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/vnd.word"
Response.ContentEncoding = System.Text.Encoding.UTF7
Response.AddHeader("Content-Disposition", "attachment;filename=History.doc")
Response.Charset = ""
EnableViewState = False
Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)
Panel2.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub

Make sure the Image - Asked By Aarthi Saravanakumar on 21-Dec-05 10:54 AM

Path is an absolute URL and not a Relative URL

Something like src="http://somepage.com/test.gif"
and not "../test.gif"

Absolute url vs Relative url - Asked By rik butcher on 21-Dec-05 11:03 AM

wow, it works like a charm! thanks so much for the info
rik