Using the help document is shows to use doc.Save and it will convert the response into a stream. This method works in the .NET 2.0 DLL but it not there in .NET 3.5.
.NET 2.0
doc.Save(Response, “PersonalizedLetter Out.doc”, ContentDisposition.Inline, null);
.NET 3.5: I had to end up using…
Document doc = new Document(System.IO.Path.Combine(DocPath, DocName));
MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.Doc);
Response.Clear();
Response.ContentType = "application/word";
Response.AddHeader("content-disposition", "inline; filename=out.doc");
byte[] bytes = stream.GetBuffer();
Response.BinaryWrite(bytes);
Response.End();
Is this the pattern to follow with .NET 3.5?
If you release a .NET 4.0 DLL will it return to the former 2.0 way of working?