Macro not effective during PowerPoint 2000 slide show

  • Thread starter Thread starter Neil Smith
  • Start date Start date
N

Neil Smith

I have defined a VB macro in PowerPoint 2000 to draw
objects. I have assigned the macro to an object using the
object's action settings (right mouse click), and click
the object during a slide show. The VB message appears but
none of the other code has any visible effect. The marco
executes OK in edit mode.

MsgBox "Test"

ActiveWindow.Selection.SlideRange.Shapes.AddLabel
(msoTextOrientationHorizontal, 268.75, 468.875, 14.5,
24#).Select
ActiveWindow.Selection.ShapeRange.TextFrame.WordWrap =
msoFalse

ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Chara
cters(Start:=1, Length:=0).Select
With ActiveWindow.Selection.TextRange
.Text = "Test"

End With
ActiveWindow.Selection.Unselect

Please can anyone help.
 
Steve's help now has me drawing things in presentations
from Macros - a big step forward. But it doesn't quite get
me where I want to be. I want to get back the name of a
clicked object.

I am looking for the Presentation equivalent of...

With ActiveWindow.Selection.ShapeRange
'msgbox .Name

....to run on a mouse click.

Is there some way of doing this, PPTEvents, etc.?
 
Steve's help now has me drawing things in presentations
from Macros - a big step forward. But it doesn't quite get
me where I want to be. I want to get back the name of a
clicked object.

I am looking for the Presentation equivalent of...

With ActiveWindow.Selection.ShapeRange
'msgbox .Name

...to run on a mouse click.

Is there some way of doing this, PPTEvents, etc.?

No events required (so it even works in '97)

Sub WhoDidYouClick(shClickedShape as Shape)
Msgbox(shClickedShape.Name)
End Sub
 
Steve,

Thanks very much - excellent. Is there any good reference
material for these type of commands. I couldn't find this
in PP help.

Regards,

Neil.
 
Thanks very much - excellent. Is there any good reference
material for these type of commands. I couldn't find this
in PP help.

Any time, Neil. (and what with newsgroup members all across the US, Canada,
Europe and Asia, I mean that quite literally <g>)

The PPT FAQ I maintain at www.pptfaq.com has a section on VB/VBA

One of the first items in the section is this:
Where can I learn more about VBA programming in PowerPoint?
http://www.rdpslides.com/pptfaq/FAQ00032.htm

That points you to the sites where I steal all my good ideas. ;-)
 
Back
Top