Shape.Height and Shape.Width problems in PowerPoint 2013

Salil Taneja picture Salil Taneja · May 14, 2013 · Viewed 11.6k times · Source

I am using a small VBA script to apply some text in the background. The script works fine on PowerPoint 2007 and PowerPoint 2010.

However, in PowerPoint 2013, setting Shape.Height and Shape.Width has no effect. Here is the snippet of the code. Any help would be appreciated.

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

Answer

user1064180 picture user1064180 · May 31, 2013

I believe this is a known limitation to the MS development team - in some instances it just doesn't fire correctly. One suggestion is to change the font size instead, but that doesn't help much if you actually need a specific font size in the shape.