Message-ID: <723942792.8661.1711654139218.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8660_1085987235.1711654139218" ------=_Part_8660_1085987235.1711654139218 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Passing between Template and Application

Passing between Template and Application

PowerPointTemplate= provides an intuitive high-performance way to import database values t= o a presentation, but cannot otherwise modify a presentation at runtime. Th= e PowerPointApplication object model allows you to modify additional aspects of the presentation = at runtime.

You can take advantage of the features of both PowerPointApp= lication and PowerPointTemplate by using them together. For example, you ca= n use PowerPointTemplate to open and populate a PowerPointWriter template, = then pass the populated presentation to PowerPointApplication to modify doc= ument properties.

PowerPointTemplate to PowerPointApplication

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

=20
 PowerPointTemplate pptt =3D new PowerPointTemplate();
pptt.Open(templatePath);
pptt.BindData(valuesArray, colNamesArray,"DataSourceName", pptt.C=
reateDataBindingProperties());
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 =3D new PowerPointApplication();
Presentation pres =3D ppta.Open(pptt);
=20
=20
 Dim pptt As PowerPointTemplate =3D new PowerPointTemplate();
pptt.Open(templatePath);
pptt.BindData(valuesArray, colNamesArray,"DataSourceName", pptt.C=
reateDataBindingProperties());
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 =3D new PowerPointApplication();
Dim pres As Presentation =3D ppta.Open(pptt);
=20

PowerPointApplication to PowerPointTemplate

To pass a presentation from PowerPointApplication to PowerPointTemplate,= do not call PowerPoi= ntApplication.Save. Instead, pass the PowerPointApplication object, along with the Presentation object that you want to popu= late, to PowerPointTemplates's Open method:

=20
 PowerPointApplication ppta =3D new PowerPointApplication();
Presentation present =3D ppta.Open("StartingFile.pptx");

//--- Code modifying and customizing the presentation here

PowerPointTemplate ppt =3D new PowerPointTemplate();
ppt.Open(ppta, present);
=20
=20
 Dim ppta As PowerPointApplication =3D new PowerPointApplicatio=
n();
Dim present As Presentation =3D ppta.Open("StartingFile.pptx");

//--- Code modifying and customizing the presentation here

Dim ppt As PowerPointTemplate =3D new PowerPointTemplate();
ppt.Open(ppta, present);
=20

 

 

------=_Part_8660_1085987235.1711654139218--