why a smiley face?!

  • Thread starter Thread starter Geoff Cox
  • Start date Start date
G

Geoff Cox

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
 
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
 
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
 
.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
 
Back
Top