Hi I posted a question last week about saving html to a document automatically to a server, well i think i found the answer below
<code>
Dim renderedOutput = New System.Text.StringBuilder
Dim strwriter = New StringWriter(renderedOutput)
Dim tWriter = New HtmlTextWriter(strWriter)
Page.RenderControl(tWriter)
Dim OUTPUT_FILENAME = tempID & ".doc"
Dim filename = Server.MapPath("files") & "\" & OUTPUT_FILENAME
Dim outputStream = New FileStream(filename, FileMode.Create)
Dim sWriter = New StreamWriter(outputStream)
sWriter.Write(renderedOutput.ToString())
sWriter.Flush()
</code>
the problem is when i compile this code i get this error:
c:\inetpub\wwwroot\CustomerTrip\worddoc2.aspx.
vb(7 88): Overload resolution failed because no accessible 'New' can be called without a narrowing conversion:
'Public Sub New(sb As System.Text.StringBuilder)': Argument matching parameter 'sb' narrows from 'System.Object' to 'System.Text.StringBuilder'.
'Public Sub New(formatProvider As System.IFormatProvider)': Argument matching parameter 'formatProvider' narrows from 'System.Object' to 'System.IFormatProvider'.
I have the two lines the error refers to highlighted in pink. any help would be really appreciated!
thanks,
Treasa