Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to Switch Arrow Pointer to Pen Pointer

Status
Not open for further replies.

dehrha02

Instructor
Jul 16, 2009
7
US
I'd like to make some command buttons to use the ppt drawing tools while I'm giving a presentation without going through the slideshow menu. Here is some code I found at the microsoft site for ppt 2000 that doesn't seem to work for ppt 2007

___________________________________________________
Code:
Private Sub CommandButton1_Click()
   With SlideShowWindows(1).View
'
' Test to see if the pointer is already in pen mode.
'
      If .PointerType = ppSlideShowPointerPen Then
'
' If it is, then set it to the Arrow pointer, and
' change the caption to "Change to Pen".
'
         .PointerType = ppSlideShowPointerArrow
         CommandButton1.Caption = "Change to Pen"
      Else
'
' If it isn't the Pen pointer, then change it to the Pen
' and set the Pen color to Red. Finally, change the caption
' to "Change to Arrow".
'
         .PointerType = ppSlideShowPointerPen
         .PointerColor.RGB = RGB(Red:=255, Green:=0, Blue:=0)
         CommandButton1.Caption = "Change to Arrow"
      End If
   End With
End Sub
_______________________________________________
and here is the link to MS site



Any help would be much appreciated
 
The code works fine for me in 2007. Although, once it's set to be the Pen tool, you aren't able to click on the button again, so the test to set it back to the pointer isn't necessary because it doesn't work.

Try this:

Sub SetPenButton()
With SlideShowWindows(1).View
.PointerType = ppSlideShowPointerPen
.PointerColor.RGB = RGB(Red:=255, Green:=0, Blue:=0)
End With
End Sub

And set the button action to run the macro "SetPenButton". WHen done with the pen tool, just click the 'esc' key to reset the pointer
 
Thank you very much. I take it if I want to switch it back to the pointer or Eraser I'll probably use things like

.PointerType = ppSlideShowPointer
.PointerType = ppSlideShowPointerEraser

Again Thanks
 
I'm doing this with an Interactive WhiteBoard (wiimote style) so I'd like to avoid the keyboard.

Could I put in another command button that does this
-if on a rollover the pointer is a pen
-then change the pointer to an arrow
-if the button is clicked then keep the button an arrow.

thanks
 
I don't think you can do that. At least with my version, when you are in the drawing mode, the mouse-over and mouse-click events are superceded by the pen (you can't click a button because the click starts drawing with the pen)

I'm not sure if there's a way around this other than the keyboard or the icons at the bottom left of the screen.
 
Thanks, I've been looking up and trying out different things I've found with no luck. Darn, so it looks like the code for those presentation mode icons are, for a lack of better terminology, deeper than we can access.

Again thanks for your help.

Is there anyway to emulate keystokes in VBA with a button?
 
Would there be anyway to automatically popup the menu that the icons at the bottom left of the sceen produce?
 
Nope-that wouldn't work either because the menu box doesn't allow you to draw while it is active.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top