Jump to content

Controlling unfocused powerpoint


Recommended Posts

I'd like/need to send powerpoint simple forward or backward controls while it is not the active window. I cannot change the active window back and forward as I'd like to change slides while the slideshow is hidden.

How might I do this?

I have tried Control send (variable $PowerTitle is correct),

ControlSend($PowerTitle,"","[CLASSNN:paneClassDC1]","{PGDN}")

and it doesn't seem to do anything (focused or not).

$handle = ControlGetHandle($PowerTitle,"","[CLASSNN:paneClassDC1]")

comes back blank as well. Using AutoInfo, the running slideshow screen reports

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: PowerPoint Slide Show - [Presentation1]

Class: screenClass

Size: X: 0 Y: 0 W: 1024 H: 768

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 480 Y: 408

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xFFFFFF Dec: 16777215

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 0 Y: 0 W: 1024 H: 768

Control ID:

ClassNameNN: paneClassDC1

Text:

Style: 0x56000000

ExStyle: 0x00000000

I have been investigating grabbing the running presentation with

$PowerObj = ObjGet("","PowerPoint.Application")

and that seems to work ($PowerObj comes back non-zero), but I'm not sure what actions I can send powerpoint through this method. I've been looking though MSoft's site but I'm afraid it's at the limit and stretching my present know-how. It seems to have .presentation and other bits, but overall, I haven't found anywhere that says these actions/methods for the Powerpoint Object. This level is just not my cup of tea.

Any clues would be appreciated.

Regards,

Saddle (In the land of Oz)

Link to comment
Share on other sites

It turns out, you can send the Powerpoint object commands to move forward or backward in a slide presentation via the NEXT or PREVIOUS method (for SlideShowWindows)

Opt("WinTitleMatchMode", 4)

$PowerObj = ObjGet("","PowerPoint.Application")

if ($PowerObj <> 0) And WinExists("classname=screenClass") Then

$PowerObj.SlideShowWindows(1).View.Previous

EndIf

You need to test for the presence of the running slide show window or the Previous/Next call fails (and terminates the AutoIt program). The object returns a non-zero value for the presence of the Powerpoint IDE, not a working slideshow. I wonder if I could test/Grab the SlideShowWindow in ObjGet instead of PowerPoint.application?

Regards,

Saddle (In the land of Oz)

Link to comment
Share on other sites

I meant to say.

The object GRAB CAN return a non-zero value for the presence of the Powerpoint IDE, not JUST a working slideshow.

Can you stop the AutoIt program terminating on a bad Com object call (a sort of "on error resume next")?

Regards,

Saddle (In the land of Oz)

Link to comment
Share on other sites

Can you stop the AutoIt program terminating on a bad Com object call (a sort of "on error resume next")?

Have a look at ObjEvent() in the helpfile. ObjEvent() can act as a COM error handler and the examples on the help page will demonstrate the usage.

:)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...