Jump to content
Sign in to follow this  
Saddle

Controlling unfocused powerpoint

Recommended Posts

Saddle

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)

Share this post


Link to post
Share on other sites
exodius

I'd say using the COM interfaced would be the best way to go (it tends to be with all of the other Office products)... And towards that end you should be able to find some examples for PowerPoint linked from this knowledge base article that you could convert to AutoIt COM format and probably be on your way.

Share this post


Link to post
Share on other sites
Saddle

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)

Share this post


Link to post
Share on other sites
Saddle

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)

Share this post


Link to post
Share on other sites
MHz

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.

:)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.