Skip to end of metadata
Go to start of metadata

Description

Saves the PowerPointTemplate to a stream passed in as the stream parameter.

C#
	
public void Save(System.IO.Stream stream)
vb.net
Public Sub Save(ByRef stream As System.IO.Stream)

Parameters

stream
A stream to write the resulting PowerPoint file to.

Exceptions

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

Examples

C#
using (PowerPointTemplate ppt = new PowerPointTemplate())
{
    ppt.Open("MyInputFilePath.pptx");
    
    using (FileStream outputFile = File.OpenWrite("MyOutputFilePath.pptx"))
    {
        ppt.Save(outputFile);
    }
}	
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
  • No labels