#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.
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 (8.77 KiB) Viewed 3337 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.
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
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.