
(There are tutorials too, in that section of the forum).Īnd finally. This site is a great reference too, although Excel and Word examples are more common. Here's an example search for " VBA Powerpoint color".
#Keyboard shortcuts for powerpoint 2013 code#
Since MSOffice is so widely used, there is generally no shortage of VBA code available online. Although at first it may seem like nonsense, this will help greatly in the long run. The above technique also has the added bonus of making the msdn easier to navigate because the site is arranged similarly to the objects and F1 help. If the post I linked to does not go into enough detail, I like to suggest this too. all the way down to the property we want to change. We start at the application, from there we want the active window, and within that we want whatever is selected.
#Keyboard shortcuts for powerpoint 2013 how to#
It basically describes how to find the property you want by starting at the Application object and "drilling down" into all the sub-objects. The first technique I describe here is what has been the most useful for me (pay special attention to the parts on the " F1 Help" and " Object Browser" too). Ex: " msdn ForeColor.RGB" or " msdn ForeColor.RGB powerpoint" Better to use a search engine and include "msdn" in your search. I've not had much luck with it in the past. I wouldn't recommend searching on that site directly. You mentioned searching the msdn for eyedropper. PixelColor := ComObject(3, PixelColor) VT_I4 = 3, a 32-bit signed int (a "Long" in VBA) In this case it expects a 32-bit signed integer (a type of number). value, they will sometimes only accept the value if it is in a specific format. PptApp := ComObjActive("Powerpoint.Application") The good news is, you probably won't have to do this for most of the shortcuts you create. But, AutoHotkey has the ability to get colors too This is a bit more advanced, simply because I had to use ComObject(3, PixelColor) - see my comments in the code. I don't have Powerpoint 2013, and the eyedropper is a new feature in that version.

With a shape selected, this sets the shape's fill color to whatever color is under your mouse at the time of pressing the hotkey. This is similar to the code I posted above. #If Turns off context sensitive hotkeys below this point If ( = 2) ppSelectionShapes = 2 (ppSelectionShapes is a Powerpoint constant) PptApp := ComObjActive("Powerpoint.Application") gets a reference to the active Powerpoint application object PPTFrameClass is the Powerpoint window class. The hotkeys below this line will only fire if Powerpoint is active * VBA basics (Word, but the same principals apply to Powerpoint) Here's an example of flipping a selected shape in the active Powerpoint window. I think COM is going to be be the most reliable by far.
