Question

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
Was it helpful?

Solution 2

This is an issue with PowerPoint 2013.

Workaround is to set

Myshape.TextFrame2.WarpFormat = msoWarpFormat37

Workaround is provided at http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/2c1cf339-aa90-4d82-9475-0ff5f49ac1b1/.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top