Skip to end of metadata
Go to start of metadata

Description

Streams a Document to an HttpResponse with the option of having it open in the user's web browser. The fileName specified will appear in the browser window. In addition, the content-type to use when streaming the file is specified.

C#
vb.net

Parameters

doc
The Document to save.
response
The HTTPResponse to write the document to.
fileName
The filename to display in the browser window.
openInBrowser
Whether to open the document in the browser window (true) or have it open in Word (false).

Exceptions

System.Exception
Thrown if there is an error streaming the document.

Remarks

For the document to open in the browser window, the "Browse in same window" option must be enabled for .doc file types on the client machine.

The WordApplication.Preserve property is used to specify the way WordWriter will save the document. When the preserve property is set to true, WordWriter attempts to preserve all formatting and features that it doesn't directly support. This includes Fields, Footnotes, Hyperlinks, Comments, and Anchored Images. When the preserve property is false, only those features directly supported by WordWriter will be preserved. This includes all Tables, Lists, Headers and Footers.

Examples

C#
vb.net
  • No labels