Excerpt |
---|
Saves the PowerPointTemplate to a stream passed in as the stream parameter. |
Signature |
---|
C# | C# | Wiki Markup |
---|
{description}
{excerpt}Saves the PowerPointTemplate to a stream passed in as the stream parameter.{excerpt}
{signature:C#}
public void Save(System.IO.Stream stream)
|
Signature |
---|
{signature}{signature:vb.net | vb.net | }
Public Sub Save(ByRef stream As System.IO.Stream)
|
...
A stream to write the resulting PowerPoint file to.
...
Save
will throw this exception if it does not have a PowerPoint document handle (Save
cannot be called before Open
).
Remarks |
---|
You can call Save more than once for a single instance of PowerPointTemplate. This allows you to save more than one copy of a generated file, and/or both save the file on the server and stream it to the client. |
Example |
---|
Code Block |
---|
| csharp | csharp |
title | C# |
---|
{signature}
{parameters}
{param:stream}A stream to write the resulting PowerPoint file to.{param}
{exceptions}
{exception:InvalidOperationException}{{Save}} will throw this exception if it does not have a PowerPoint document handle ({{Save}} cannot be called before {{Open}}).
{exception}
{remarks}You can call {{Save}} more than once for a single instance of [PowerPointTemplate]. This allows you to save more than one copy of a generated file, and/or both save the file on the server and stream it to the client.{remarks}
{example}
{code:csharp|title=C#}
using (PowerPointTemplate ppt = new PowerPointTemplate())
{
ppt.Open("MyInputFilePath.pptx");
using (FileStream outputFile = File.OpenWrite("MyOutputFilePath.pptx"))
{
ppt.Save(outputFile);
}
}
Code Block |
---|
vbnet | vbnet | title | {code}
{code:vbnet|title=vb.net
}
Using ppt As New PowerPointTemplate()
ppt.Open("MyInputFilePath.pptx");
Using outputFile As File.OpenWrite("MyOutputFilePath.pptx")
ppt.Save(outputFile);
End Using
End Using
{code}
{example}