Lescasse Consulting
 Home    Company    News    Prices    Download    Buy    Forums   
Read Me
Buy
Forums
Resume
AntiSpam 1.2
wBackup 1.11
NetAccess 2.0
Visual APL 1.0 
APL+Win 8.0 
APL+Win Products 
APL+Win Objects™ 
APL+Win Training 
APL+Web Services
APL+Web Component 
APL+ History
Dyalog.Net Tutorial
Conferences 
Powerpoint
White Papers
Web Hosting
References
Links
 
APL+Win Objects™ 6.0

TADO5
TADO5 Tutorial
TAPLDraw5
TAPLEdit5
TAPLSession5
TAbale5
TAboutBox5
TAccess5
TAgent5
TBlatMail5
TButton5
TCDO5
TCRC5
TCancelButton5
TCheck5
TCheckGroup5
TChildForm5
TChooseColor5
TChooseFont5
TClipBoard5
TClock5
TCodeStats5
TColors5
TCombo5
TComboDrive5
TComboFilter5
TComboList5
TComboTree5
TCommandBar5
TCommandButton5
TControlClass5
TCueCard5
TDHTML5
TDHTMLEditor5
TDateTime5
TDateTimeFr5
TDates5
TDemoHandlers5
TDisplay5
TDOS5
TDualSelect5
TEdit5
TEditAmount5
TEditDir5
TEditEnter5
TEditFile5
TEditGrid5
TEditList5
TEditListview5
TEditMenu5
TEditNum5
TEditSelect5
TEditSpin5
TEmail5
TError5
TExampleForm5
TExcel5
TExcel5 Tutorial
TFindReplace5
TFOne5
TFTP5
TFTP5 Tutorial
TFileCompare5
TFileMenu5
TFileMenuDef5
TFlatButton5
TForm5
TFormClass5
TFormEditor5
TFrame5
TGetDir5
TGif5
TGifForm5
TGifWb5
TGoMenu5
TGraphX5
TGrid5
TGridDisplay5
TGridPrint5
TGUID5
THLine5
THTML5
THTML5 Tutorial
THTTP5
THelp5
THelpMenu5
TImagelist5
TInfo5
TIniFile5
TInstall5
TInternet5
TJpg5
TJpgWb5
TLabel5
TList5
TListview5
TLock5
TLogs5
TMAPI5
TMath5
TMDIForm5
TMSOutlook5
TMaskEdit5
TMedia5
TMenu5
TMessage5
TModalCall5
TMsgBox5
TNavigator5
TNetwork5
TNonVisualClass5
TODBC5
TOKButton5
TObject5
TOpenFile5
TOption5
TOptionGroup5
TOutlook5
TOutlookMail5
TOWCSpread5
TPDF5
TPFKeys5
TPage5
TPassword5
TPicture5
TPing5
TPopupMenu5
TPowerpoint5
TPowerpoint5 Tutorial
TPrinter5
TProgress5
TProgressDlg5
TQuestion5
TRegistry5
TRegistryKey5
TResource5
TRichEdit5
TSPX5
TSQLDMO5
TScheduler5
TScroll5
TSelector5
TSpinner5
TSplitter5
TStatus5
TStopWatch5
TTest5
TTestError5
TTextFile5
TTimer5
TTip5
TTipForm5
TTLI5
TToolBar5
TToolbox5
TToolsMenu5
TTrackbar5
TTranslate5
TTree5
TVLine5
TViewMenu5
TWebBrowser5
TWebServer5
TWebSite5
TWebSiteNet5
TWinMenu5
TWord5
TYesNo5
    Visits:  2678 (37 on line) Last Update: Dec 15, 2005  
    TPowerpoint5 Tutorial    Printer Friendly  
TPowerpoint5 Tutorial

TPowerpoint5 is an object designed to let you use Microsoft Powerpoint in your APL+Win applications.

 

You can use TPowerpoint5 to:

 

l    programmatically create Powerpoint presentations

l    enhance or change Poserpoint presentations

l    publish Powerpoint presentations on the Web

l    create effects in Powerpoint presentations which would be very difficult to achieve otherwise

l    play Powerpoint presentations

 

 Instanciating TPowerpoint5

 

As for other APL+Win Objects, TPowerpoint5 does not show itself by default when you instanciate it:

 

      'ee'Świ'*Create' 'TPowerpoint5'

 

However you may show TPowerpoint5 as you instanciate it:

 

      'ee'Świ'*Create' 'TPowerpoint5'('visible'1)

 

TPowerpoint5_1.gif

TPowerpoint5_1.gif

 

When TPowerpoint5 is instanciated, it contains no presentation. To create a presentation at the time you instanciate TPowerpoint5, use its AddPresentation method with an argument of 1 to display it.

 

     'pp'Świ'*Create' 'TPowerpoint'('AddPresentation'1)('visible'1)

 

TPowerpoint5_2.gif

TPowerpoint5_2.gif

 

Finally, you may want to set TPowerpoint5 to stay on top of all other windows by setting its ontop property:

 

      'ee'Świ'*Create' 'TPowerpoint'('AddPresentation'1)('visible'1)('ontop'1)

 

Please note that the AddPresentation argument has a different meaning than the TExcel AddBook method argument: it means show or hide the Presentation which the AddBook argument represent the number of workbooks to create.

 

Since, most of the time, you want to create TPowerpoint5 as done just above, I have created a Show method for TPowerpoint5 which does the same. Use it this way:

 

      'ee'Świ'*Create' 'TPowerpoint' 'Show'

 

If you want to use Show but don’t want to let TPowerpoint5 stay on top of your other windows:

 

      'ee'Świ'*Create' 'TPowerpoint' 'Show'('ontop'0)

 

 Understanding TPowerpoint5

 

A Powerpoint object contains a Presentations object which itself is made of Presentation objects.

 

Each Presentation may contain a Slides object which is a collection of Slide object.

 

Each Slide object may contain a Shapes object which is a collection of Shape objects.

Shapes are what you ultimately see in slides.

 

There also is a master slide object (internally called SlideMaster) which serves as a template for each slide you are creating.

 

Therefore, if you want to have a consistent way of presenting and formatting your slides throughout your presentation, you should set properties on the SlideMaster object.

 

You indicate that you want to set properties on the SlideMaster object by selecting slide 0:

 

      'pp'Świ'slide'0

 

 TPowerpoint5 Properties and Methods

 

Here is the set of TPowerpoint5 properties:

 

      70 TELPRINTś'pp'Świ'Properties'

class help ontop visible where

 

and methods:

 

      70 TELPRINTś'pp'Świ'Methods'

AddPresentation  First            Next             ShapeDelete

AddSlide         Hide             Open             ShapeSelect

AddTable         Last             OrigScale        Show

CellBackColor    Load             Previous         Slide

Close            MoveBottom       Quit             SlideTitle

ColumnWidths     MoveLeft         Run              Title

ComputeColors    MoveRight        RunInAplWindow   Titles

FillTable        MoveTop          Scale

FillTableColors  NbSlides         ScaleHeight

FindTables       New              ScaleWidth

 

 Closing TPowerpoint5

 

There are several ways a TPowerpoint5 object can be deleted.

 

First you may programmatically call its Quit method:

      'ee'Świ'Quit'

 

Second, you may close the instance of TPowerpoint5 with your mouse by simply closing Powerpoint. However this does not remove Powerpoint from memory.

      'ee'Świ'*self'
ee

If you want to remove Powerpoint from memory, you must still call its Quit method.

 

You must be careful to NOT create a new instance of TPowerpoint5 without having first completely remove the first instance from memory using the Quit method. If you fail to do so, methods like the Quit method may no longer work.

 

So, the good rule is: whenever you want to create an instance of TPowerpoint5, first delete any instance of the same name which may already be running.

 

For this purpose I have create the small handy utility function Powerpoint, which reads as follows:

 

    ’ Powerpoint

[1] :if 0¬˝'pp'Świ'*self' Ş 'pp'Świ'Quit' Ş :end

[2] 0 0˝'pp'Świ'*Create' 'TPowerpoint' 'Show' 'SessionFocus'

    ’
 

Whenever you create an instance of TPowerpoint5 use instructions similar as the ones in function Powerpoint.

 

Note that the SessionFocus method is not a TPowerpoint5 method: it is inherited from TCommon and returns the focus to the APL session as soon as TPowerpoint5 is instanciated.

 

 Loading An Existing Presentation

 

To open an existing Powerpoint presentation, call the Open method with the full name of the .ppt presentation file:

 

      'pp'Świ'Open' 'c:\aplwin\objects\aplwin95.ppt'

 

TPowerpoint5_3.gif

TPowerpoint5_3.gif

 

 Working With Slides

 

Creating a New Slide

 

Let’s first start with a new instance of TPowerpoint5.

 

      Powerpoint

 

You may add a new slide to your presentation with the AddSlide method:

 

      'pp'Świ'AddSlide'1 12

 

TPowerpoint5_4.gif

TPowerpoint5_4.gif

 

The first AddSlide argument is the slide number. The slide is added just before the slide you specify. If there is no slide in the presentation yet, use 1 to create the first slide as we did above. If you try to use a slide out of range, you get an error:

 

      'pp'Świ'AddSlide'5 12

ŚWI ERROR: Microsoft PowerPoint 2002 exception 80048240 Slides.Add : Integer out of range. 5 is not in Index's valid range of 1 to 3.

TPowerpoint[159] Świ( '*xActivePresentation.Slides.XAdd>:slide'),Śwarg[2 3]

                         ^

 

Slide 5 cannot be added because there is no slide 4 yet.

 

The second argument is the type of slide you want to create. Use a number from the following table:

Type

Powerpoint constant

12

(ppLayoutBlank)

8

(ppLayoutChart)

6

(ppLayoutChartAndText)

10

(ppLayoutClipartAndText)

26

(ppLayoutClipArtAndVerticalText)

24

(ppLayoutFourObjects)

15

(ppLayoutLargeObject)

18

(ppLayoutMediaClipAndText)

16

(ppLayoutObject)

14

(ppLayoutObjectAndText)

19

(ppLayoutObjectOverText)

7

(ppLayoutOrgchart)

4

(ppLayoutTable)

2

(ppLayoutText)

5

(ppLayoutTextAndChart)

9

(ppLayoutTextAndClipart)

17

(ppLayoutTextAndMediaClip)

13

(ppLayoutTextAndObject)

21

(ppLayoutTextAndTwoObjects)

20

(ppLayoutTextOverObject)

1

(ppLayoutTitle)

11

(ppLayoutTitleOnly)

3

(ppLayoutTwoColumnText)

22

(ppLayoutTwoObjectsAndText)

23

(ppLayoutTwoObjectsOverText)

25

(ppLayoutVerticalText)

27

(ppLayoutVerticalTitleAndText)

28

(ppLayoutVerticalTitleAndTextOverChart)

 

Using 12 as the second argument as we did above, adds a blank slide.

 

Now let’s add a slide with a title:

 

      'pp'Świ'AddSlide'2 1

 

TPowerpoint5_5.gif

TPowerpoint5_5.gif

 

If you try to add a slide again before slide 2, you will insert a slide between slide 1 and slide 2. Let’s add a slide with a table (type 4) in it:

 

      'pp'Świ'AddSlide'2 4

 

TPowerpoint5_6.gif

TPowerpoint5_6.gif

 

Still one more example : let’s create a slide with vertical text and a clipart:

 

      'pp'Świ'AddSlide'4 26

 

TPowerpoint5_7.gif

TPowerpoint5_7.gif

 

Thus, with the simple AddSlide method you can quickly create all the slides of your presentation.

 

You will then need to populate them with the correct data, images, titles, tables, objects and format them using foreground and background colors, etc.

 

Remember: use an index of 1 to insert a slide before slide 1 and an index of 1+number of slides to insert a slide at the end of the currently existing slides.

 

 Querying the Number of Existing Slides

 

Run the NbSlides method to know how many slides there are in your presentation:

 

      'pp'Świ'NbSlides'

4

 

 Deleting a Slide

 

To delete a slide use the DeleteSlide method passing to it the slide number.

 

      'pp'Świ'DeleteSlide'3

 

When you delete slide N, the slide which becomes active is the new slide which gets number N. If no such slide, it is the last slide in the presentation which becomes active.

 

You may also delete all slides in the presentation using the DeleteAllSlides method:

 

      'pp'Świ'DeleteAllSlides'

 

 Selecting a Slide

 

Before you can work on a slide, you must select it and activate it with the slide property.

 

Example:

 

      'pp'Świ'slide'3

 

This selects slide 3 and activates it.

 

 Changing Slides Properties

 

Slide Background Color

 

You may change the slide background color using the slidebackcolor property:

 

      'pp'Świ'slidebackcolor'(255 255 153)

 

Slide Background Pattern

 

You may change the slide background pattern by using the slidepattern property.

Be sure to first select the slide you want to work on:

 

      'pp'Świ'slide'2

 

There are 48 possible patterns whose names are:

msoPattern10Percent

msoPatternLargeConfetti

msoPattern20Percent

msoPatternLargeGrid

msoPattern25Percent

msoPatternLightDownwardDiagonal

msoPattern30Percent

msoPatternLightHorizontal

msoPattern40Percent

msoPatternLightUpwardDiagonal

msoPattern50Percent

msoPatternLightVertical

msoPattern5Percent

msoPatternMixed

msoPattern60Percent

msoPatternNarrowHorizontal

msoPattern70Percent

msoPatternNarrowVertical

msoPattern75Percent

msoPatternOutlinedDiamond

msoPattern80Percent

msoPatternPlaid

msoPattern90Percent

msoPatternShingle

msoPatternDarkDownwardDiagonal

msoPatternSmallCheckerBoard

msoPatternDarkHorizontal

msoPatternSmallConfetti

msoPatternDarkUpwardDiagonal

msoPatternSmallGrid

msoPatternDashedDownwardDiagonal

msoPatternSolidDiamond

msoPatternDashedHorizontal

msoPatternSphere

msoPatternDashedUpwardDiagonal

msoPatternTrellis

msoPatternDashedVertical

msoPatternWave

msoPatternDiagonalBrick

msoPatternWeave

msoPatternDivot

msoPatternWideDownwardDiagonal

msoPatternDottedDiamond

msoPatternWideUpwardDiagonal

msoPatternDottedGrid

msoPatternZigZag

msoPatternHorizontalBrick

msoPatternDarkVertical

msoPatternLargeCheckerBoard

 

 

Let’s select pattern 40:

 

      'pp'Świ'slidepattern'10

 

TPowerpoint5_8.gif

TPowerpoint5_8.gif

 

Slide Color Gradient

 

To enhance the look of your slide you may apply a color gradient to it:

 

      'pp'Świ'slidegradient'3 4 7

 

The first parameter is the type of gradient to be chosen among:

msoGradientDiagonalDown

msoGradientFromTitle

msoGradientDiagonalUp

msoGradientHorizontal

msoGradientFromCenter

msoGradientMixed

msoGradientFromCorner

msoGradientVerticaL

 

The second parameter can be 1 to 4 except for msoGradientFromTitle and msoGradientFromCenter where it can only be 1 or 2.

 

The third parameter is the PresetGradientType to be chosen among:

msoGradientBrass

msoGradientMahogany

msoGradientCalmWater

msoGradientMoss

msoGradientChrome

msoGradientNightfall

msoGradientChromeII

msoGradientOcean

msoGradientDaybreak

msoGradientParchment

msoGradientDesert

msoGradientPeacock

msoGradientEarlySunset

msoGradientRainbow

msoGradientFire

msoGradientRainbowII

msoGradientFog

msoGradientSapphire

msoGradientGold

msoGradientSilver

msoGradientGoldII

msoGradientWheat

msoGradientHorizon

msoPresetGradientMixed

msoGradientLateSunset

 

     

TPowerpoint5_9.gif

TPowerpoint5_9.gif

 

Slide Texture

 

You may set a texture to the background of your slide by setting its slidetexture property as follows:

 

      'pp'Świ'slidetexture'5

 

where the slidetexture argument is a preset texture number (from 1 to 24).

 

Possible textures are:

msoPresetTextureMixed

msoTextureOak

msoTextureBlueTissuePaper

msoTexturePaperBag

msoTextureBouquet

msoTexturePapyrus

msoTextureBrownMarble

msoTextureParchment

msoTextureCanvas

msoTexturePinkTissuePaper

msoTextureCork

msoTexturePurpleMesh

msoTextureDenim

msoTextureRecycledPaper

msoTextureFishFossil

msoTextureSand

msoTextureGranite

msoTextureStationery

msoTextureGreenMarble

msoTextureWalnut

msoTextureMediumWood

msoTextureWaterDroplets

msoTextureNewsprint

msoTextureWhiteMarble

 

msoTextureWovenMat

 

The previous example would display the following slide texture:

 

TPowerpoint5_10.gif

TPowerpoint5_10.gif

 

 

 Applying a Template

 

Even more spectacular is the possibility to apply a template to your presentation.

 

This is very easily done using the template property.

 

You must simply pass the complete file name of a .POT template file. Example:

 

      'pp'Świ'template' 'C:\Program Files\Microsoft Office\Templates\Presentation Designs\Mountain Top.pot'

 

This result in ALL the slides in your presentation to adopt the specified template.

 

TPowerpoint5_11.gif

TPowerpoint5_11.gif

 

Note that you can omit the path of your template file if it is:

 

C:\Program Files\Microsoft Office\Templates\Presentation Designs\

 

This is where you normally find all the.POT template files delivered with Powerpoint.

 

Thus, we could have written the last example as:

 

      'pp'Świ'template' 'Mountain Top.pot'

 

 Working With Shapes

 

Just as you can select a slide to work with the slide and change its properties, you can select a Shape in a slide to work with it and get or set its properties.

 

Selecting A Shape

 

To select a shape in a slide, simply use the shape property, passing to it the shape number:

 

      'pp'Świ'shape'2

 

This means: select shape number 2 in the currently active slide.

 

When you select a shape this way, you immediately see which shape was selected.

 

Example:

'pp'Świ'shape'1

TPowerpoint5_12.gif

'pp'Świ'shape'2

TPowerpoint5_13.gif

 

This allows you to visually check that you are have selected the right shape.

 

Selecting a shape is a prerequisite to starting to get or set its properties or running its methods.

 

Querying the Number of Shapes in Your Slide

 

Run the NbShapes method to know how many shapes there are in the currently active slide.

 

      'pp'Świ'NbShapes'

2

 

Deleting a Shape

 

To remove a shape from a slide, use the DeleteShape method and pass it the number of the shape to delete:

 

      'pp'Świ'DeleteShape'2

 

Deleting All Shapes in A Slide

 

Use the DeleteAllShapes to remove all shapes from a slide:

 

      'pp'Świ'DeleteAllShapes'

 

Adding New Shapes

 

All kinds of new shapes can be added to a presentation.

 

Let’s first create a new blank slide:

 

      'pp'Świ'AddSlide'5 12

 

Use the AddTextBox method to add a text box to the presentation:

 

      'pp'Świ'AddTextBox'0 50 100 100 200 'This is a TextBox'

1

 

Note that this method returns the shape number of the just created shape and selects it.

 

Similarly an image shape can be added to the slide by using the AddPicture method:

 

      'pp'Świ'AddPicture' 'C:\Program Files\Common Files\Borland Shared\Images\Splash\16Color\earth.bmp'200 200 150 200

2

 

TPowerpoint5_14.gif

TPowerpoint5_14.gif

 

 Working With Text

 

Changing the Slide Title

 

Use the slidetitle property to change the slide title:

 

      'pp'Świ'slide'2

      'pp'Świ'slidetitle' 'APL+Win 5.0'

 

TPowerpoint5_15.gif

TPowerpoint5_15.gif

 

Working with Text in Shapes

 

First select the shape you want to work with. Then set its shapetext property.

 

Example:

 

      'pp'Świ'slide'2

      'pp'Świ'shape'1

      'pp'Świ'shapetext' 'APL+Win 5.0 Enhancements'

      'pp'Świ'shape'2

      'pp'Świ'shapetext'('New Registry Object',Śtcnl,'Elastic Workspaces',Śtcnl,'APL+Draw OCX Drawing Faclity')

 

TPowerpoint5_16.gif

TPowerpoint5_16.gif

 

It is therefore extremely easy to programmatically create a complete presentation with text slides from APL.

 

Changing Fonts

 

Once you have installed text in your shape, you may want to change font name, size or attribute (bold, italic, etc.) for the whole text or only part of it.

 

Text in a shape is made of Paragraphs and each Paragraph is made of Words.

 

An item in a list is considered to be a paragraph.

 

For example, in the above slide “APL+Win 5.0 Enhancements” is a paragraph, just like “Elastic Workspaces”.

 

You use the following properties to work with fonts:

fontbold

fontcolor

fontemboss

fontitalic

fontname

fontshadow

fontsize

 

All these properties accept 3 arguments:

 

the first one is the paragraph number (or 0 to mean all paragraphs in the shape)

the second one is the word number in the paragraph (or 0 for all words in the paragraph)

the third one is the new value

 

Examples:

'pp'Świ'slide'2

'pp'Świ'shape'1

'pp'Świ'fontbold'0 0 1

TPowerpoint5_17.gif

TPowerpoint5_17.gif

'pp'Świ'shape'2

'pp'Świ'fontbold'1 2 1

'pp'Świ'fontbold'3 1 1

TPowerpoint5_18.gif

TPowerpoint5_18.gif

'pp'Świ'fontname'2 0 'Times New Roman'

'pp'Świ'fontitalic'2 0 1

TPowerpoint5_19.gif

TPowerpoint5_19.gif

'pp'Świ'fontsize'3 2 60

TPowerpoint5_20.gif

TPowerpoint5_20.gif

'pp'Świ'fontbold'3 2 1

'pp'Świ'fontshadow'3 2 1

 

Note: the word OCX has been magnified to see the fondshadow effect

TPowerpoint5_21.gif

TPowerpoint5_21.gif

'pp'Świ'fontcolor'1 2(255 0 0)

'pp'Świ'fontcolor'2 0(0 192 0)

'pp'Świ'fontcolor'3 0(0 0 255)

TPowerpoint5_22.gif

TPowerpoint5_22.gif

'pp'Świ'fontemboss'1 0 1

TPowerpoint5_23.gif

TPowerpoint5_23.gif

 

 Saving Your Presentation

 

Once you have work a bit defining a new presentation, you want to save it.

 

If it’s a new presentation, you must use the SaveAs method to first save your presentation.

 

l    The first SaveAs argument is the complete file name

l    The 2nd SaveAs argument is the file format, one of:
 

13=ppSaveAsHTMLv3

4=ppSaveAsPowerPoint3

8=ppSaveAsAddIn

3=ppSaveAsPowerPoint4

19=ppSaveAsBMP

10=ppSaveAsPowerPoint4FarEast

11=ppSaveAsDefault

2=ppSaveAsPowerPoint7

16=ppSaveAsGIF

1=ppSaveAsPresentation

12=ppSaveAsHTML

6=ppSaveAsRTF

14=ppSaveAsHTMLDual

7=ppSaveAsShow

17=ppSaveAsJPG

5=ppSaveAsTemplate

15=ppSaveAsMetaFile

21=ppSaveAsTIF

18=ppSaveAsPNG

20=ppSaveAsWebArchive

 

 Headers And Footers

 

Headers are currently not available for TPowerpoint5.

 

Footers are defined using the footer, the footerdate and footerslide properties.

 

Footers are only defined with TPowerpoint5 at the SlideMaster level, i.e. they apply to all slides in your presentation.

 

Example:

'pp'Świ'footer' 'APL+Win 5.0 Presentation'

TPowerpoint5_24.gif

TPowerpoint5_24.gif

'pp'Świ'footerdate'1

TPowerpoint5_25.gif

TPowerpoint5_25.gif

'pp'Świ'footerdate'2

TPowerpoint5_26.gif

TPowerpoint5_26.gif

'pp'Świ'footerdate'3

TPowerpoint5_27.gif

TPowerpoint5_27.gif

'pp'Świ'footerdate'4

TPowerpoint5_28.gif

TPowerpoint5_28.gif

'pp'Świ'footerslide'1

TPowerpoint5_29.gif

TPowerpoint5_29.gif

 

The possible date formats are:

1

1/3/2003

2

Friday, January 3, 2003

3

3 January 20003

4

January 3, 2003

5

3-Jan-03

6

January 03

7

Jan 03

8

1/3/2003 9:38 AM

9

1/3/2003 9:38:35 AM

10

09:38

11

09:38:35

12

9:38 AM

13

9:38:35 AM

 

 Running A Presentation

 

Once your presentation is ready, you can run it using the Run method.

 

This hides the TPowerpoint5 window. At the end of the presentation it is your responsibility to show it back again using the Hide method with an argument of 0.

 

      'pp'Świ'Run'

 

Click the screen to move from one slide to the next one.

 

At the end of the presentation, do:

 

      'pp'Świ'Hide'0

 

to show the TPowerpoint5 window.

 

You can optionally use several arguments to the Run method: they are described below:

 

mode

The presentation display mode

1=full screen with mouse box;

2=window;

3=full screen without mouse box

startingslide

The starting slide number (0= defaults to first slide)

endingslide

The ending slide number (0= defaults to last slide)

top

The top position in pixels of the Powerpoint window (0 for full screen display)

left

The left position in pixels of the Powerpoint window

height

The height in pixels of the Powerpoint window

width

The width in pixels of the Powerpoint window

ontop

The topmost state of the Powerpoint window

1=on top

0=normal

 

Example:

 

      'pp'Świ'Run'1 2 3 150 200 546 728 1

 

TPowerpoint51.png

TPowerpoint5_30.gif

 

The Powerpoint presentation showing slides 2 and 3 (here slide 2) is displayed on the screen at the specified location, in a window with no border. Just click on the slide to move to next slide or to show the next slide item.

 

Here is how it gets displayed on the screen.:

 

TPowerpoint5_31.gif

TPowerpoint5_31.gif

 

 Running A Presentation

 

Even more spectacular is the possibility to display your Powerpoint presentations embedded into your APL forms.

 

To do so you must use the RunInAplWindow method which accepts 4 or 5 arguments

handle

handle or name of the APL object which is to display the Powerpoint presentation: this can be a Form, Page or Frame

startingslide

the starting slide number (0= defaults to first slide)

endingslide

the ending slide number (0= defaults to last slide)

colseAPLwindow

a boolean indicating if the window has to be automatically closed at the end of the presentation (1) or not (0)

Wavfilename

the .wav file to be automatically played when opening the presentation

 

 

The following simple function demonstrates how you could display a Powerpoint presentation in a TFrame5 object embedded in a TPage5 object in a TForm5:

 

    ’ PowerpointDemo;Z;text1;text2;Śwself

[1] :if 0=˝'pp'Świ'*self' Ş PpExample Ş :end

[2] Śwself„'pptdemo'Świ'*Create' 'TForm5'('*size'450 650)('ontop'1)

[3] Z„Świ'*icon' 'c:\aplwin\objects\aplwin.ico'

[4] Z„Świ'*caption' 'Powerpoint Presentation in an APL Window'