0
votes

I am facing an issue with the custom textbox in a PowerPoint 2010 slide. I want to make the text that is initially there inside the textbox (say "Click to enter text") to disappear as soon as mouse is clicked on the textbox to enter some text. If this is possible through events in VBA, I would like to know which event(associated with the textbox) to capture and how to do it using VBA?

Also changing the height parameter is not having any effect in PowerPoint 2010.

here is my code that defines the textbox :

Dim sld As Slide

Set pShape = sld.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=50, Top:=50, width:=500, Height:=300)

pShape.TextFrame.TextRange = "Click to enter text"
pShape.TextFrame.TextRange.Font.Size = 14
pShape.Line.Visible = True
pShape.Line.ForeColor.RGB = RGB(0, 0, 0)
pShape.Line.DashStyle = msoLineDash

Plz help me out with this.. Thanks in advance!!!

1

1 Answers

0
votes

The height is not taking because the default is to resize to fit availabl text.

Either use a shape not a textbox or reset the defaut

Set pShape = sld.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=50, Top:=50, Width:=500, Height:=300) pShape.TextFrame.AutoSize = ppAutoSizeNone pShape.Height = 300

Making the text disappear on click is possible but difficult. You can use the WindowSelectionChange event but this is very difficult to set up if you are not writing an addin. You would need to write a WithEvents Class module and initialise an instance. Fairly advanced!