Page 1 of 1

Microsoft Powerpoint Automation Using Comate

Posted: Tue May 31, 2016 5:48 pm
by PeteM
I am trying to get the Hwnd of the current Powerpoint running slideshow window. The documentation describes it as SlideShowWindow.HWND, and I am trying to retrieve it with this code:

Code: Select all

Declare.i Hwnd
Hwnd = PPTObject\GetIntegerProperty("Presentation\SlideShowWindow\HWND")
but it returns a "Method/property not supported by this object error".

The VB example given by Microsoft is:

Code: Select all

'Declaration
ReadOnly Property HWND As Integer
	Get
'Usage
Dim instance As SlideShowWindow
Dim value As Integer

value = instance.HWND
I guess the problem is that I am not declaring the SlideShowWindow object, but I dont know its structure (if that is indeed the way to do this).

Help appreciated!

Re: Microsoft Powerpoint Automation Using Comate

Posted: Thu Jun 02, 2016 2:16 pm
by spikey
I'm not sure because I can't test it for myself but I think you're having problems because the Presentation object is indeterminate when you issue the call. An indeterminate object will have no methods or properties.

Try using the ActivePresentation or Presentations(1) objects which should be determinate. Failing that try getting a Presentation as an intermediate object with GetObjectProperty on the application object then getting the SlideShowWindow\HWND from the intermediate object.

You didn't include the application instantiation code so I'm assuming that it is properly instantiated here, if not that will be the cause of the problem.