Capesoft Office Inside
Vote for this Product at ClarionShop
 
Buy now at ClarionShop


CapeSoft Software copyright
www.capesoft.com

c3pa approved
     

 

 

Microsoft PowerPoint Functionality



Contents
  * Templates  
* Classes
  The oiPowerPoint Class
    Methods
    Equates
 
* Dll Functions
 
*  Useful References
  Tips & FAQs
 
* Return to the Main Office Inside Docs
     

end of section

*Templates

Add_MSPowerPoint_Object
  Summary  
Procedure Extension Template
Add an MS PowerPoint object to a procedure
Optional
 
What does it do?
This template is used to add MS PowerPoint functionality to a procedure in your app.  We are still developing it and adding functionality to it, more info will come later.
 
Prerequisites
You need to have added the Activate_Office_Inside global extension template before you can add this template to a procedure.
 
How do I implement it?
  1. Select the procedure which you want to add this template to.
  2. Select "Properties..." from the "Edit" menu
  3. Click the "Extensions" button
  4. Click on the "Insert" button to add a new extension template
  5. Select "Add_MSPowerPoint_Object" ( found under the "Class OfficeInside" group )
  6. Click "Select", then "OK", then "OK" again...

What are my options?

General Tab:

Object Name:

This is the name of the Office Inside object that this template will create and implement.  Typically this would default to 'MyPowerPoint1', but you can change it if you would prefer to call the object something else.

 

     

 

end of section

*Classes

This section describes the various classes which make up "Office Inside".  Each class contains methods and properties, which are documented below.  Each method is documented by giving the method name, the parameters, an example of how to code the method, a list describing what the method does, and additional comments below.

*The oiPowerPoint Class - Introduction

The oiPowerPoint class is a "wrapper" class, which is used by the templates and by other classes as the "communication" layer between Office Inside and MS PowerPoint.  Should you wish to write code which communicates "directly" with MS PowerPoint, this is the class you're looking for.

*The oiPowerPoint Class - Methods

oiPowerpoint Method Reference
 
Method Description

ClosePresentation

Closes the currently open presentation

CountOpenPresentations

Returns the number of open presentations

EndShow

Ends a slidehow

FirstSlide

Moves to the first slide in a show

GetInfo

Retrieves properties of the slideshow or Powerpoint

Init

Initialises the oiPowerpoint object and Powerpoint

Kill

Cleans up and releases the instance of Powerpoint

LastSlide

Navigates to the last slide in the show

NextSlide

Navigates to the next slide

OpenPresentation

Opens a Powerpoint presentation

PreviousSlide

Navigates to the previous slide
SaveAs Saves the presentation to file, in a number of formats

ViewShow

Starts a show
 
     


ClosePresentation     ( ) ,byte,proc
MyPowerPoint.ClosePresentation ()

  • Closes the currently open presentation.

CountOpenPresentations     ( ) ,long
if MyPowerPoint.CountOpenPresentations() > 0
...

  • Returns the number of currently open presentations.

EndShow     ( )
MyPowerPoint.EndShow()

  • If you are currently viewing a presentation, this method will stop it.

up icon

horizontal rule

FirstSlide     ( )
MyPowerPoint.FirstSlide()

  • If you are currently viewing a presentation, this method will load the first slide.

up icon

horizontal rule

GetInfo     ( byte pOption ) ,string,proc
i# = MyPowerPoint.GetInfo(oip:Width)

  • Used to get information from the Power Point object.

up icon

horizontal rule

Init     ( byte pStartVisible=1, byte pEnableEvents=1 ) ,byte,proc
MyPowerPoint.Init (true, false)

  • Initializes the PowerPoint object.  Must be called before you can use any of the other methods.  If you are using the Office Inside templates this method will be called automatically.
  • The two parameters are of no use at this time, as the object will always initialize with PowerPoint being visible, and events turned off.

up icon

horizontal rule

Kill     ( byte pUnloadCOM=1 ) ,byte,proc
MyPowerPoint.Kill()

  • Closes down and disposes of the PowerPoint object, as well as the numerous objects used internally by the PowerPoint object.  The templates will generate code to call this method.

up icon

horizontal rule

LastSlide     ( )
MyPowerPoint.LastSlide()

  • If you are currently viewing a presentation, this method will load the last slide.

up icon

horizontal rule

NextSlide     ( )
MyPowerPoint.NextSlide()

  • If you are currently viewing a presentation, this method will load the next slide in sequence.

up icon

horizontal rule

OpenPresentation ( string pFileName, byte pReadOnly=1 ) ,byte,proc
MyPowerPoint.OpenPresentation (longpath() & '\csoi.ppt')

  • Opens a Power Point presentation, as specified by the pFileName parameter.

up icon

horizontal rule

PreviousSlide ( )
MyPowerPoint.PreviousSlide()

  • If you are currently viewing a presentation, this method will load the previous slide in sequence.

up icon

horizontal rule

SaveAs (string fileName, long fileFormat, long embedFonts), long

The SaveAs method saves the currently loaded and active presentation to a file. The file name and type can both be specified. PowerPoint supports saving as a large variety of files, although not all formats support all the data that can be stored in a presentation. For example you can export the summary to RTF by using SaveAs and setting the fileFormat parameter to oip:ppSaveAsRTF.

Parameters

fileName - the file name to save the document as (for example 'PowerPoint Outline.rtf')'
fileFormat - the format to save the file as (see below for the values allowed for this parameter)
embedFonts - whether to embed fonts into the new document (only applies to formats that allow font embedding)

The supported values for the fileFormat parameter are:

 Equate and value  Description
oip:ppSaveAsPresentation       equate(1) 
oip:ppSaveAsPowerPoint7 equate(2)
oip:ppSaveAsPowerPoint4 equate(3) oip:ppSaveAsPowerPoint3 equate(4)
oip:ppSaveAsTemplate equate(5)
oip:ppSaveAsRTF equate(6)
oip:ppSaveAsShow equate(7)
oip:ppSaveAsAddIn equate(8)
oip:ppSaveAsPowerPoint4FarEast equate(10)
oip:ppSaveAsDefault equate(11)
oip:ppSaveAsHTML equate(12)
oip:ppSaveAsHTMLv3 equate(13)
oip:ppSaveAsHTMLDual equate(14)
oip:ppSaveAsMetaFile equate(15)
oip:ppSaveAsGIF equate(16)
oip:ppSaveAsJPG equate(17)
oip:ppSaveAsPNG equate(18)
oip:ppSaveAsBMP equate(19)
oip:ppSaveAsWebArchive equate(20)
oip:ppSaveAsTIF equate(21)
oip:ppSaveAsPresForReview equate(22)
oip:ppSaveAsEMF equate(23)

Presentation (a standard PowerPoint .ppt file)
PowerPoint 7 Presentation (.ppt)
PowerPoint 4 Presentation (.ppt)
PowerPoint 3 Presentation (.ppt)
PowerPoint Template (.pot)
Outline/RTF (.rtf)
PowerPoint Show (.pps)
PowerPoint Add-In ( .ppa)
-
-
Web Page (.htm; .html )
Web Page (.htm; .html )
-
Windows Metafile (.wmf)
GIF Graphics Interchange Format (.gif)
JPEG File Interchange Format (.jpg')
PNG Portable Network Graphics Format (.png)
Device Independant Bitmap (.bmp)
Single File Web Page (.mht; .mhtml)
Tagged Image File Format (.tiff)
-
Enhanced Metafile (.emf)

Return Values
The function returns 1 (true) for success and zero (false) for failure,

Simple Example

    MyPowerPoint1.SaveAs ((LongPath() & '\Test.ppt'), oip:ppSaveAsPresentation, true)

Full Example

The below example displays a File Dialog for choosing the file name and type (if the user does not enter the file extension then it is appended to the name for them). The extension is then checked and the SaveAs method is called with the fileFormat parameter set to the equate that matches the selected file type. Not that for document with multiple pages selecting an image format such as Bitmap, JPEG, PNG etc. will create a folder with an image for each page. The folder is given the same name as the filename specified in the Save As dialog box. See the DemoC6 example which contains this code.

fileFormats         string(512)                         ! String containing the file formats string for a filedialog
fileName string(File:MaxFilename) ! String to store the file name
fileType long ! The file type, one of the supported equates
i long ! Loop counter fileFormats = 'Presentation |*.ppt |Design Template |*.pot |Show |*.pps |PowerPoint Add-In |*.ppa |' | & 'Web Page |*.htm |Single File Web Page |*.mht |GIF Graphics Interchange Format |*.gif |' | & 'PNG Portable Network Graphics Format |*.png |JPEG File Interchange Format |*.jpg |' | & 'Device Independant Bitmap |*.bmp |Windows Metafile |*.wmf |Enhanced Metafile |*.emf |Outline(RTF) |*.rtf |All Files |*.*' if FileDialog('Save As...', fileName, fileFormats , File:Save + File:KeepDir + File:AddExtension + File:LongName) ! Get the file extention so that we can tell which type of file is needed loop i = Len(Clip(fileName)) to 1 by -1 if fileName[i] = '.' ! found the extension position case( Lower( fileName[i + 1 : Len(Clip(fileName))] ) ) of 'ppt' fileType = oip:ppSaveAsPresentation of 'pot' fileType = oip:ppSaveAsTemplate of 'pps' fileType = oip:ppSaveAsShow of 'ppa' fileType = oip:ppSaveAsAddIn of 'htm' orof 'html' fileType = oip:ppSaveAsHTML of 'mht' orof 'mhtml' fileType = oip:ppSaveAsWebArchive of 'gif' fileType =oip:ppSaveAsGIF of 'png' fileType = oip:ppSaveAsPNG of 'jpg' orof 'jpeg' fileType = oip:ppSaveAsJPG of 'bmp' fileType = oip:ppSaveAsBMP of 'wmf' fileType = oip:ppSaveAsMetaFile of 'emf' fileType = oip:ppSaveAsEMF of 'rtf' fileType = oip:ppSaveAsRTF else Message('Sorry but an unknown or invalid file type was specified (' & Lower( fileName[i + 1 : Len(Clip(fileName))] ) & ').') break end if not MyPowerPoint1.SaveAs (Clip(fileName), fileType, false) Message('Failed to save document') else Message('Document saved to: ' & Clip(fileName)) end end end end

horizontal rule

ViewShow     ( )
MyPowerPoint.ViewShow ()

  • Once you have opened a Power Point presentation, you can use this method to start viewing the Slide Show.

up icon

horizontal rule


*The oiPowerPoint Class - Equates

( See csoffice.inc )


end of section

*Dll Functions

At this time we have documented all functions for all the Office components in the "main" OfficeInside.htm document.  Click here to go to that section.


end of section

*Useful References

*Tips & FAQs

This section contains Tips and Frequently Asked Questions pertaining only to the MS PowerPoint parts of Office Inside.  For Tips and FAQ's pertaining to the product as a whole, or to other components, please click here.

No MS PowerPoint FAQs yet...




[end of document]