Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Description

Excerpt

Saves the generated Word file on the server.

Signature
C#
C#
 public void Save(System.String outputFileName)
{signature}
{signature:
}
Signature
vb.net
vb.net
Public Sub Save(ByVal outputFileName As String)
{signature}
{parameters}
{param: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.
{param}
{exceptions}
{exception:ArgumentNullException}{{Save}} will throw this exception if {{null}} \(C\#\) or {{Nothing}} \(VB.NET\) is passed to the method.
{exception}
{remarks}You can call [Save|WordTemplate.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.

{remarks}
{example}{code:csharp|title=C#}
Parameters
Param
strFilePath
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
Exception
ArgumentNullException
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.

Example
Code Block
csharp
csharp
titleC#


          WordTemplate oWW = new WordTemplate();
          oWW.Open(@"c:\templates\Template.doc");
          oWW.SetDataSource(arrValue, arrName);
          oWW.Process();
          oWW.Save(@"c:\reports\Report.doc");
        
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}


          Dim oWW As New WordTemplate()
          oWW.Open("c:\templates\Template.doc")
          oWW.SetDataSource(arrValue, arrName)
          oWW.Process()
          oWW.Save("c:\reports\Report.doc")
        
{code} {example}