Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To pass a presentation from PowerPointTemplate to PowerPointApplication, do not call PowerPointTemplate.Save. Instead, pass the PowerPointTemplate object to PowerPointApplication's Open method:

Code Blockcsharp
c#c#
PowerPointTemplate pptt = new PowerPointTemplate();
pptt.Open(templatePath);
pptt.BindData(valuesArray, colNamesArray,"DataSourceName", pptt.CreateDataBindingProperties());
pptt.Process();

//--- Create an instance of PowerPointApplication and
//--- open the presentation you created with PowerPointTemplate.
//--- The presentation will be returned as a Presentation
//--- object.
PowerPointApplication ppta = new PowerPointApplication();
Presentation pres = ppta.Open(pptt);
Vbnet

Option Strict On
Option Explicit On

Dim pptt As PowerPointTemplate = new PowerPointTemplate();
pptt.Open(templatePath);
pptt.BindData(valuesArray, colNamesArray,"DataSourceName", pptt.CreateDataBindingProperties());
pptt.Process();

//--- Create an instance of PowerPointApplication and
//--- open the presentation you created with PowerPointTemplate.
//--- The presentation will be returned as a Presentation
//--- object.
Dim ppta As PowerPointApplication = new PowerPointApplication();
Dim pres As Presentation = ppta.Open(pptt);