RotationEffect.By Property
Sets or returns a Single that represents the rotation of an object by the specified number of degrees; for example, a value of 180 means to rotate the object by 180 degrees. Read/write.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
Property By As Single
Get
Set
'Usage
Dim instance As RotationEffect
Dim value As Single
value = instance.By
instance.By = value
float By { get; set; }
Property Value
Type: System.Single
Remarks
The specified object will be rotated with the center of the object remaining in the same position on the screen.
If both the By and To properties are set for a rotation effect, then the value of the By property is ignored.
Floating point numbers (for example, 55.5) are valid, but negative numbers are not.
Do not confuse this property with the ByX or ByY properties of the ScaleEffect and MotionEffect objects, which are only used for scaling or motion effects.
Examples
This example adds a rotation effect and changes its rotation.
Sub AddAndChangeRotationEffect()
Dim effBlinds As Effect
Dim tmlnShape As TimeLine
Dim shpShape As Shape
Dim animBehavior As AnimationBehavior
Dim rtnEffect As RotationEffect
'Sets shape, timing, and effect
Set shpShape = ActivePresentation.Slides(1).Shapes(1)
Set tmlnShape = ActivePresentation.Slides(1).TimeLine
Set effBlinds = tmlnShape.MainSequence.AddEffect _
(Shape:=shpShape, effectId:=msoAnimEffectBlinds)
'Adds animation behavior and sets rotation effect
Set animBehavior = tmlnShape.MainSequence(1).Behaviors _
.Add(Type:=msoAnimTypeRotation)
Set rtnEffect = animBehavior.RotationEffect
rtnEffect.By= 270
End Sub