Ppt_Get (like Excel_Get or Word_Get)

Post your working scripts, libraries and tools
burque505
Posts: 495
Joined: 22 Jan 2017, 19:37

Ppt_Get (like Excel_Get or Word_Get)

18 Mar 2018, 17:50

Hi all, on the heels of Word_Get.ahk a similar function for Powerpoint. Please test, break, mangle, report :D
Thanks!

Ppt_Get.ahk
Spoiler

Here's an example script.

Code: [Select all] [Download] GeSHi © Codebox Plus

#Include Ppt_Get.ahk

F7:: ; Press F7 to display Powerpoint's caption.
pptApp := Ppt_Get()
if !IsObject(pptApp) ; If Ppt_Get fails it returns an error message instead of an object.
{
MsgBox, 16, Ppt_Get Error, % pptApp
return
}
MsgBox, % "Caption: " pptApp.Caption
return


EDIT March 23, 2018: I'm posting jeeswg's code for this, which works on multiple versions. I've tested it on 64-bit PowerPoint 2013 & 2016, jeeswg tested it on PP 2007. Should work in 2010 without problems, but I haven't tested it yet. You'll probably want to change the function name in the example code above from PPT_Get() to PowerPoint_Get() when using jeeswg's code, or else change PowerPoint_Get to PPT_Get in jeeswg's code.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus




Works on my Win7 64-bit system, AHK 1.1.28.00 64-bit
Regards,
burque505
Last edited by burque505 on 23 Mar 2018, 16:52, edited 1 time in total.
clina1j
Posts: 49
Joined: 22 Apr 2016, 18:39

Re: Ppt_Get (like Excel_Get or Word_Get)

22 Mar 2018, 13:32

Alright, so I gave it a try. It looked very promising and Excel_Get, and Word_Get work just fine. But Ppt_Get is giving the following error message

PPTGet Error.png
PPTGet Error.png (8.77 KiB) Viewed 463 times


I am using Windows 7, and Office 2010 on a 64 bit computer. And my company handles people healthcare information, so the security is PARANOID.
Any ideas?

PS, I just tripple check that Excel_Get and Word_Get work on my computer. I pasted the code for all three into a new script, and ran the example Caption script for all three programs, with brand new empty documents open up for each. I got the Captions for Word and Excel, and the same error message for PowerPoint.
burque505
Posts: 495
Joined: 22 Jan 2017, 19:37

Re: Ppt_Get (like Excel_Get or Word_Get)

22 Mar 2018, 18:36

For those using Office 2010, this will choke (thanks clina1j). PowerPoint 2010 uses a "paneClassDC" control, and 2013 - 2016 use "mdiClass". For those who have 2010, try the code by awel20 in this thread. I've only tested it on XP in a VM, but it works fine.
Regards,
burque505
User avatar
jeeswg
Posts: 4595
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Ppt_Get (like Excel_Get or Word_Get)

22 Mar 2018, 19:07

You can incorporate code like this to handle window and control class variants.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

burque505
Posts: 495
Joined: 22 Jan 2017, 19:37

Re: Ppt_Get (like Excel_Get or Word_Get)

22 Mar 2018, 19:17

That code definitely works, jeeswg, thanks. Let me experiment with plugging it into the original function.
Regards,
burque505
User avatar
jeeswg
Posts: 4595
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Ppt_Get (like Excel_Get or Word_Get)

22 Mar 2018, 20:06

I've updated my original function to incorporate the ideas above. You're welcome to use any code from it in your function. If you are able to test my function, that would be great. Cheers.

Excel_Get is AMAZING, could someone make a PowerPoint_Get? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=44286&p=207745#p207745
burque505
Posts: 495
Joined: 22 Jan 2017, 19:37

Re: Ppt_Get (like Excel_Get or Word_Get)

23 Mar 2018, 16:42

Thanks, jeeswg. I'm going to put your code in the OP.
Regards,
burque505
sixtyone
Posts: 3
Joined: 30 Jun 2018, 00:59

Re: Ppt_Get (like Excel_Get or Word_Get)

30 Jun 2018, 01:07

could someone make a AutoCAD_Get?

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 16 guests