Skip to end of metadata
Go to start of metadata

Description

Saves the generated Word file on the server.

C#
 public void Save(System.String outputFileName)
vb.net
Public Sub Save(ByVal outputFileName As String)

Parameters

strFilePath
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.

Exceptions

ArgumentNullException
Save will throw this exception if null (C#) or Nothing (VB.NET) is passed to the method.

Remarks

You can call Save more than once for a single instance of WordTemplate. This allows you to save more than one copy of a generated file and/or save the file on the server and stream it to the client.

Examples

C#

          WordTemplate oWW = new WordTemplate();
          oWW.Open(@"c:\templates\Template.doc");
          oWW.SetDataSource(arrValue, arrName);
          oWW.Process();
          oWW.Save(@"c:\reports\Report.doc");
        
vb.net

          Dim oWW As New WordTemplate()
          oWW.Open("c:\templates\Template.doc")
          oWW.SetDataSource(arrValue, arrName)
          oWW.Process()
          oWW.Save("c:\reports\Report.doc")
        
  • No labels