wtfwtf 发表于 2017-10-15 15:58:10

RGBColor RotationEffect对象在VBA之PPT中的范例

        一、RGBColor 对象
  代表配色方案中的一种颜色。
  如何使用RGBColor对象?
  使用 Colors 方法可返回一个 RGBColor 对象。可以将一个 RGBColor 对象赋给另一个 RGBColor 对象。可使用 RGB 属性设置或返回 RGBColor 对象的显式红-绿-蓝值(对于由 ppNotSchemeColor 和ppSchemeColorMixed 常数定义的 RGBColor 对象除外,这两个对象的 RGB 属性可被返回,但不可设置)。以下示例将当前演示文稿配色方案的背景色设为红色,并将标题颜色设为第二个配色方案中定义的标题颜色。
  With ActivePresentation.ColorSchemes
   .Item(1).Colors(ppBackground).RGB = RGB(240, 0, 0)
   .Item(1).Colors(ppTitle) = .Item(2).Colors(ppTitle)
  End With
  二、RotationEffect 对象
  代表 AnimationBehavior 对象的旋转效果。
  如何使用RotationEffect 对象?
  使用 AnimationBehavior 对象的 RotationEffect 属性返回 RotationEffect 对象。以下示例引用了给定动画动作的旋转效果。
  ActivePresentation.Slides(1).TimeLine.MainSequence.Item.Behaviors(1).RotationEffect
  使用 RotationEffect 对象的 By、From 和 To 属性影响对象的动画旋转。以下示例向第一张幻灯片添加新的形状并设置旋转动画动作。
  Dim shpNew As Shape
  Dim effNew As Effect
  Dim aniNew As AnimationBehavior
  Set shpNew = ActivePresentation.Slides(1).Shapes _
.AddShape(Type:=msoShape5pointStar, Left:=0, _
Top:=0, Width:=100, Height:=100)
  Set effNew = ActivePresentation.Slides(1).TimeLine.MainSequence _
.AddEffect(Shape:=shpNew, effectId:=msoAnimEffectCustom)
  Set aniNew = effNew.Behaviors.Add(msoAnimTypeRotation)
  With aniNew.RotationEffect
  'Rotate 270 degrees from current position
  .By = 270
  End With
  End Sub

edwardyou 发表于 2017-10-15 16:01:30

说的不错

jxc201 发表于 2017-10-17 23:58:33

嘿...反了反了,,,,
页: [1]
查看完整版本: RGBColor RotationEffect对象在VBA之PPT中的范例