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 / October 2006

Tip: Looking for answers? Try searching our database.

why a smiley face?!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Geoff Cox - 30 Oct 2006 10:16 GMT
Hello,

I cannot see why a smiley face appears for the

Type:=msoTextBox

in the code below?

A Microsoft joke?!

Cheers

Geoff

Sub AddMotionPath()

    Dim shpNew As Shape
    Dim effNew As Effect
    Dim aniMotion As AnimationBehavior

    Set shpNew = ActivePresentation.Slides(1).Shapes _
        .AddShape(Type:=msoTextBox, Left:=100, _
         Top:=300, Width:=100, Height:=100)
         shpNew.TextFrame.TextRange.Text = "moving word"
    Set effNew = ActivePresentation.Slides(1).TimeLine.MainSequence _
        .AddEffect(Shape:=shpNew, effectId:=msoAnimEffectCustom, _
        Trigger:=msoAnimTriggerWithPrevious)
    Set aniMotion = effNew.Behaviors.Add(msoAnimTypeMotion)

    With aniMotion.MotionEffect
        .FromX = 0.00000638889
        .FromY = -0.0000037037
        .ToX = 0.48039
        .ToY = -0.32569
    End With

End Sub
John Wilson - 30 Oct 2006 12:29 GMT
Dont know why you got a smiley (I did too) but you need to AddTextbox NOT
AddShape I think

Substitute this in your code and see if it works

.AddTextbox(Orientation:=msoTextOrientationHorizontal, Left:=100, _
Top:=300, Width:=100, Height:=100)

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html

> Hello,
>
[quoted text clipped - 33 lines]
>
> End Sub
Geoff Cox - 30 Oct 2006 13:18 GMT
>.AddTextbox(Orientation:=msoTextOrientationHorizontal, Left:=100, _
>Top:=300, Width:=100, Height:=100)

Thanks John - that did the trick!

How about the one below? The aim is to click on shpAnswer to move the
shpRectangle in the way defined by the FromX etc.

This works and uses the FromX etc co-ordinates and ignores the

effectId:=msoAnimEffectPathCurvyStar, _

which is fine! But what should replace this parameter? A gap is not
allowed and adding msoAnimEffectCustom is wrong.

Cheers

Geoff

Sub AddShapeSetTiming()

Sub AddShapeSetTiming()

Dim effDiamond As Effect
Dim shpRectangle As Shape
Dim aniMotion As AnimationBehavior
Dim shpAnswer As Shape

'create shape to be clicked
Set shpAnswer = ActivePresentation.Slides(1).Shapes _
.AddShape(Type:=msoShapeRectangle, Left:=100, _
Top:=400, Width:=75, Height:=50)
shpAnswer.TextFrame.TextRange.Text = "answer"

'create shape to be moved
Set shpRectangle = ActivePresentation.Slides(1).Shapes _
.AddShape(Type:=msoShapeRectangle, Left:=100, _
Top:=200, Width:=75, Height:=50)
shpRectangle.TextFrame.TextRange.Text = "word"

'effect applies to the shape to be moved when other shape is clicked
Set effDiamond = _
ActivePresentation.Slides(1).TimeLine.InteractiveSequences.Add _
.AddEffect(Shape:=shpRectangle, _
effectId:=msoAnimEffectPathCurvyStar, _
Trigger:=msoAnimTriggerOnShapeClick)

With effDiamond.Timing
.Duration = 2
.TriggerDelayTime = 0
End With

Set aniMotion = effDiamond.Behaviors.Add(msoAnimTypeMotion)

With aniMotion.MotionEffect
      .FromX = 0.00000638889
     .FromY = -0.0000037037
   .ToX = 0.48039
   .ToY = -0.32569
   
End With

effDiamond.Timing.TriggerShape = shpAnswer
End Sub
Andy Pope - 30 Oct 2006 12:39 GMT
Hi,

You get the smiley face when adding a shape because the constants share
the same value.

msoShapeSmileyFace = 17
msoTextBox  = 17

Use the AddTextbox method as suggested by John.

Cheers
Andy

> Hello,
>
[quoted text clipped - 33 lines]
>
> End Sub

Signature

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

John Wilson - 30 Oct 2006 12:50 GMT
Thanks Andy, mystery solved!

_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html

> Hi,
>
[quoted text clipped - 46 lines]
> >
> > End Sub
 
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.