Dzwebs.Net

撰写电脑技术杂文十余年

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

Admin | 2013-7-24 10:21:26 | 被阅次数 | 5288

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

  一、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


该杂文来自: PowerPoint杂文

上一篇:PublishObject对象与PublishObject 集合

下一篇:VBA之PPT里面的Row和Rows集合对象

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计