ASP.NET Reference: WordTemplate Object Open SetCultureInfo SetDataSource GetVersion Process Save
ASP Reference: WordTemplate Object Open SetCultureInfo SetDataSource GetVersion Process Save

ASP Programmer's Reference

WordTemplate.Save Method


Save(FileName)
Saves the generated Word file on the server.
Save(response)
Streams the generated Word file to the client.
Save(response, attachmentName, OpenInBrowser)
Streams the generated Word file to the client.

Save(FileName)

Syntax:
Sub WordTemplate.Save(FileName As String)
Description:

Saves the generated Word file on the server.

Parameters:
  • FileName
    Specifies a complete path and file name for the generated file. WordWriter will save the file to this location. If a file with the same name exists, it will be overwritten by the new Word file.

Example:
	[VB]
	arrValues = Array("SoftArtisans", "WordWriter", "http://www.softartisans.com")
	arrNames = Array("CompanyName", "ProductName", "URL")
	Set oWW = Server.CreateObject("SoftArtisans.WordTemplate")
	oWW.Open(Server.MapPath("./Template.doc"))
	oWW.SetDataSource arrValues, arrNames
	oWW.Process
	oWW.Save "C:\Output\Output.doc"
	Set oWW = Nothing

Top


Save(response)

Syntax:
Sub WordTemplate.Save(response As ASP Response)
Description:

If you pass Save the ASP Response object, WordWriter will stream the generated file to the client. If the user chooses to open (rather than save) the file, it will open in the browser window.

Parameter:
  • response
    The ASP Response object.
Example:
	[VB]
	arrValues = Array("SoftArtisans", "WordWriter", "http://www.softartisans.com")
	arrNames = Array("CompanyName", "ProductName", "URL")
	Set oWW = Server.CreateObject("SoftArtisans.WordTemplate")
	oWW.Open(Server.MapPath("./Template.doc"))
	oWW.SetDataSource arrValues, arrNames
	oWW.Process
	oWW.Save Response
	Set oWW = Nothing

Top


Save(response, attachmentName, openInBrowser)

Syntax:
Sub WordTemplate.Save(response As ASP Response,_
        attachmentName As String,_
        OpenInBrowser As Boolean)
Description:

If you pass Save the ASP response object, WordWriter will stream the generated file to the client. This method allows you to specify a default client-side file name, and whether the file should be opened in the browser window or in Microsoft Word.

Parameters:
  • response
    The ASP response object.
  • attachmentName
    Specifies a name for the generated Word file; this name will be displayed in the download dialog when the file is streamed to the browser.
  • openInBrowser
    If openInBrowser is set to true, and the user chooses to open the file, the file will open in the browser window. If openInBrowser is set to false, and the user chooses to open the file, the file will open in Microsoft Word. By default, the file will open in the browser window. Note: not all browsers can embed a Word file in the browser window.
Example:
	[VB]
	arrValues = Array("SoftArtisans", "WordWriter", "http://www.softartisans.com")
	arrNames = Array("CompanyName", "ProductName", "URL")
	Set oWW = Server.CreateObject("SoftArtisans.WordTemplate")
	oWW.Open(Server.MapPath("./Template.doc"))
	oWW.SetDataSource arrValues, arrNames
	oWW.Process
	oWW.Save Response, "Output.doc", False 
	Set oWW = Nothing

Top

ASP.NET Reference: WordTemplate Object Open SetCultureInfo SetDataSource GetVersion Process Save
ASP Reference: WordTemplate Object Open SetCultureInfo SetDataSource GetVersion Process Save


Copyright © 2003, SoftArtisans, Inc.