Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / September 2007

Tip: Looking for answers? Try searching our database.

i have a problem with powerpoint macro...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nushi - 24 Sep 2007 13:23 GMT
Does any one know how i can get the shape name or text inside the
shape when the user click on it and i active a macro?
i need to know that on the macro itself...
i have few shapes with the same macro on them
thenks :)
John Wilson - 24 Sep 2007 14:34 GMT
Try this

Sub nameofsub(oshp As Shape)
Dim oshp As Shape
Dim strName As String
Dim strText As TextColumn2
strName = oshp.Name
If oshp.HasTextFrame Then
If oshp.TextFrame.HasText Then
strText = oshp.TextFrame.TextRange
End If
End If
End Sub
Signature

Amazing PPT Hints, Tips and Tutorials-
http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk

> Does any one know how i can get the shape name or text inside the
> shape when the user click on it and i active a macro?
> i need to know that on the macro itself...
> i have few shapes with the same macro on them
> thenks :)
nushi - 24 Sep 2007 16:12 GMT
it does'nt work...
i have this code :
Sub AddGroup(oshp As Shape)
Dim x As Integer
Dim y As Integer
x = 130
y = 170
Dim mySlide As Slide
Dim oshp As Shape
Dim strName As String
Dim strText as TaxtColumn2
If oshp.HasTextFrame Then
If oshp.TextFrame.HasText Then
strText = oshp.TextFrame.TextRange
End If
End If
Set mySlide = ActivePresentation.Slides.Item(13)
Dim NumberOfElements As Integer
NumberOfElements = mySlide.Shapes.Count
x = x + ((NumberOfElements - 2) * 30)
y = y + ((NumberOfElements - 2) * 30)
If (x > 250) Then
x = x - (x - 120)
End If
If (y > 250) Then
y = y - (y - 120)
End If
mySlide.Shapes.Title.TextFrame.TextRange.text = strText.text
   Dim myShape As Shape
Set myShape = mySlide.Shapes.AddShape(msoShapeOval, x, y, 272.12,
272.12)

End Sub
the problem is that my PowerPoint Macro Editor does'nt know what is
TextColumn and it looks like i can't go into the macro from my
powerpoint if i use Sub AddGroup(oshp As Shape)
thenks for all your help...
John Wilson - 24 Sep 2007 16:40 GMT
Sorry that was an example of DIM flying fingers

I meant "as String"
Signature

Amazing PPT Hints, Tips and Tutorials-
http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk

> it does'nt work...
> i have this code :
[quoted text clipped - 33 lines]
> powerpoint if i use Sub AddGroup(oshp As Shape)
> thenks for all your help...
Steve Rindsberg - 24 Sep 2007 16:00 GMT
> Does any one know how i can get the shape name or text inside the
> shape when the user click on it and i active a macro?
> i need to know that on the macro itself...
> i have few shapes with the same macro on them
> thenks :)

Give the shape an action setting of Run Macro and assign it to run this macro:

Sub AboutThisShape(oShp As Shape)

   MsgBox oShp.Name
   
   If oShp.HasTextFrame Then
       If oShp.TextFrame.HasText Then
           MsgBox oShp.TextFrame.TextRange.Text
       End If
   End If

End Sub

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
nushi - 24 Sep 2007 16:18 GMT
> In article <1190636587.526644.158...@k79g2000hse.googlegroups.com>, Nushi
> wrote:
[quoted text clipped - 24 lines]
> PPTools:  www.pptools.com
> ================================================

thenks that helped
:):):)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.