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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to assign name in PowerPoint VBA?

Status
Not open for further replies.

suhaimi

Technical User
Aug 3, 2001
71
US
Hi,

I have these lines of codes in PPT VBA:
ActiveWindow.Selection.SlideRange.Shapes.AddTextEffect(msoTextEffect16, "A", "Arial Black", 96#, msoFalse, msoFalse, 322.38, 201.88).Select
With ActiveWindow.Selection.ShapeRange
.IncrementLeft -94.38
.IncrementTop -111.88
End With
ActiveWindow.Selection.Unselect
ActiveWindow.Selection.SlideRange.Shapes("WordArt 2").Select
With ActiveWindow.Selection.ShapeRange
.IncrementLeft 132#
.IncrementTop 96#
End With
ActiveWindow.Selection.Unselect

How do I assign this to a name and manipulate it instead of using "WordArt 2" ???
I wish to do like this:
Myworkart=ActiveWindow.Selection.SlideRange
ActiveWindow.Selection.myworkart.select
With myworkart
.IncrementLeft 132#
.IncrementTop 96#
End With

Please help...

Thanks,
Suhaimi
 
Not exactly sure what you're trying to do. Maybe this will be close:

set Myworkart=ActiveWindow.Selection.SlideRange.Shapes("WordArt 2")
With myworkart
.IncrementLeft 132#
.IncrementTop 96#
End With

Whichever way you go, you will first have to identify the object you want to work with by name (unless you want to work with all of them, as you do in the first part of your code).
Note that you need the "set" keyword to assign an object reference.
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top