【发布时间】:2013-05-14 07:04:02
【问题描述】:
我正在使用一个小的 VBA 脚本在后台应用一些文本。该脚本在 PowerPoint 2007 和 PowerPoint 2010 上运行良好。
但是,在 PowerPoint 2013 中,设置 Shape.Height 和 Shape.Width 无效。这是代码的sn-p。任何帮助将不胜感激。
Public Sub applyWatermark()
Dim curDesign As Design
Set curDesign = ActivePresentation.Designs.Item(1)
Dim masterSlide As Master
Set masterSlide = curDesign.SlideMaster
Dim shape As shape
Set shape = masterSlide.Shapes.AddTextbox(msoShapeRectangle, 0#, 0#, 100#, 100#)
shape.TextEffect.Text = "Watermark"
' Setting height and width works fine on PPT 2010 but does not work on PPT 2013
shape.Height = 200
shape.Width = 300
shape.TextFrame2.WordWrap = msoTrue
shape.TextFrame2.WarpFormat = msoWarpFormat1
shape.Left = 200
shape.Top = 200
End Sub
【问题讨论】:
-
您是否尝试过在
Set shape = masterSlide.Shapes...中设置高度和宽度属性??也许这样会更可靠。 -
我在 msdn 上发布了这个问题,并找到了将 warpFormat 设置为 msoWarpForm37 的解决方法,并且成功了。
标签: vba powerpoint office-2013