Command button inactivates keyboard in Powerpoint 2007

S

steve p

I made a series of command buttons on a Master Slide, each linked to VBA that
lets me change to various pen colors or change to an eraser during a slide
show just by clicking on the button (useful for annotating slides during a
presentation with a Wacom Cintiq monitor).

e.g. change to a red pen:

Dim View As SlideShowView
Set View = ActivePresentation.SlideShowWindow.View
With View
.PointerColor.RGB = RGB(255, 0, 0) 'Red
.PointerType = ppSlideShowPointerPen
End With
End Sub

e.g. change to an eraser:

Private Sub CommandButton6_Click()
Dim View As SlideShowView
Set View = ActivePresentation.SlideShowWindow.View
With View
.PointerType = ppSlideShowPointerEraser
End With
End Sub

This worked fine with previous versions of Powerpoint, but I have a problem
with PowerPoint 2007 (seen with both Vista and XP). The buttons themselves
work fine, in that during a slide show clicking on the "red" one changes to a
red pen, clicking the "eraser" button changes it to an eraser, etc. However,
with PowerPoint 2007, immediately after clicking any of my custom buttons the
keyboard is now inactivated, as if it has gone into kiosk mode. No key does
anything, meaning that I can’t advance to the next slide or go back to the
previous slide using the arrow keys, the return key doesn’t advance to the
next slide, and ctrl-A or ctrl-P doesn’t change the cursor to a pen or arrow.
If I move the cursor to the left or right arrow at the lower left of the
slide I can advance to the next slide or go back a slide (as if it were in
kiosk mode), and this reactivates the keyboard. But if I click on another of
my command buttons the keyboard is inactivated again.
I tried putting the following at the end of the VBA for one of my buttons:

With ActivePresentation.SlideShowSettings
.ShowType = ppShowTypeWindow
End With

to force it out of Kiosk mode if for some reason it had gone into kiosk, but
that didn't have any effect.

Does anyone have any idea how to get the keyboard to reactivate?
 
S

steve p

I discovered that the problem is more general that I had thought. If I create
a new presentation, then simply insert a command button from the developer
toolbar, I get the same behavior (i.e. just insert the button and don't add
any VBA code). I start the slideshow, and the keyboard works fine (I can
switch to pen with ctrl-p, arrow keys navigate through the show). But if I
click on the command button, the keyboard inactivates until I advance to the
next slide using the cursor and the slide's control. I must have some setting
misconfigured somewhere? But, I see the behavior on three different
computers, one running Vista and two with XP, so I can't figure out what my
problem is.

steve p
 
S

steve p

Steve,

Thanks for the info. I found that I don't even have to go to a different
slide. If I get the SlideIndex for the current slide, then after changing the
pen color just go to this index, the keyboard is reset. This avoids an
annoying flash where the presentation flips to another slide and then flips
back. Thanks for the suggestion.

It seems odd that such a huge bug (command buttons break the keyboard!)
slipped through, though.

steve p
 
S

steve p

I haven't figured out how to do that. I created a shape (a circle) on the
slide that has the VBA code, then did Insert->Action. I get the "Action
Settings" dialog box, but for "Mouse Click" the "Run macro" and "Object
Action" choices are grayed out. What do I have to do to be able to assign the
macro to the shape?

steve p
 
S

steve p

I just figured out why I couldn't assign macros and was able to do so.
However, my code doesn't behave quite the same way the command buttons do.
For example, if I make several macros:

Sub redpenmacro()
Dim oView As SlideShowView
Set oView = ActivePresentation.SlideShowWindow.View
With oView
.PointerColor.RGB = RGB(255, 0, 0) 'Red
.PointerType = ppSlideShowPointerPen
End With
End Sub

Sub arrowmacro()
'Procedure to change the PowerPoint pointer to an arrow pointer
'Stephen Poole, U.C. Santa Barbara, 10-19-2006
Dim oView As SlideShowView
Set oView = ActivePresentation.SlideShowWindow.View
With oView
.PointerType = ppSlideShowPointerArrow
End With
End Sub

(other macros to turn the pen different colors)

and assign each macro to a different shape on the slide, when I start the
slide show the pointer starts as an arrow. When I position it over the "red"
shape, it changes from an arrow to a pointing finger, and when I click it it
does turn into a red pen. However, it always stays a red pen. If I place it
over the "arrow" shape it doesn't change to a pointing finger, and a
subsequent click doesn't turn back into an arrow. I have to do ctrl-A to get
it to go back to an arrow in order to click on any other "shape" buttons.
With the command buttons whenever the mouse is over the command button a
click will activate it; you don't have to first call up the arrow pointer.

steve p
 
S

steve p

One last impediment is that if I save the .pptm file with the now working
command buttons as a PowerPoint 2003 compatible file then open it back up in
PowerPoint 2007 the buttons no longer work (I believe they'll work if you
open it up in PowerPoint 2003, though). I was hoping to have one file I could
give out to others that would work with either PP 2003 or 2007, but it looks
like I'll have to have separate files for each. Oh well.

At any rate, thanks for your help in getting a workable solution!

steve p
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top