Log in

View Full Version : Macro - How to press keystrokes / key combinations?



JamieG193
12-13-2012, 12:48 PM
Hi all

I need a way to enable the user toggle Windows High Contrast on presentations. I was thinking that this may be possible using a macro that presses Shift + Ctrl + Print Screen (shortcut to enable high contrast).

I can't seem to find a way of performing such a simple task in PowerPoint (I'm very new to VBA). If anybody knows a way of doing this, please let us know!

Thanks in advance.

John Wilson
12-13-2012, 02:24 PM
What version Jamie?

For me shift+CTRL+printscreen doesn't work.

Application.CommandBars.ExecuteMso("ViewDisplayInPureBlackAndWhite") works as does Application.CommandBars.ExecuteMso("ViewDisplayInColor")
using ViewDisplayInHighContrast should work but fails here.

JamieG193
12-13-2012, 02:44 PM
What version Jamie?

For me shift+CTRL+printscreen doesn't work.

Application.CommandBars.ExecuteMso("ViewDisplayInPureBlackAndWhite") works as does Application.CommandBars.ExecuteMso("ViewDisplayInColor")
using ViewDisplayInHighContrast should work but fails here.

My apologies, the shortcut is actually Alt +Shift + Print Screen (just tried this and it works - Windows 7).

So just to confirm, to switch to high contrast I would simply apply:
Application.CommandBars.ExecuteMso("ViewDisplayInPureBlackAndWhite")

and then to return to colour:
Application.CommandBars.ExecuteMso("ViewDisplayInColor")

as a macro onto a button?

John Wilson
12-14-2012, 07:37 AM
No, I just checked they set the view to B&W which is not the same thing. I don't see any code way of switching the proiper high contrast (Alt Shift PrtScr) You can't send prtScr using SendKeys so that won't work either