TextFrame2.HasText Property
Indicates whether the shape that contains the specified text frame has text associated with it. Read-only.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
ReadOnly Property HasText As MsoTriState
Get
'Usage
Dim instance As TextFrame2
Dim value As MsoTriState
value = instance.HasText
MsoTriState HasText { get; }
Property Value
Type: Microsoft.Office.Core.MsoTriState
MsoTriState
Remarks
The value of the HasText property can be one of the following MsoTriState constants.
Constant |
Description |
---|---|
msoFalse |
The specified text frame does not have text. |
msoTrue |
The specified text frame has text. |
Examples
The followin example tests whether shape two on slide one contains text, and if it does, resizes the shape to fit the text.
Public Sub HasText_Example()
Dim pptSlide As Slide
Set pptSlide = ActivePresentation.Slides(1)
With pptSlide.Shapes(2).TextFrame
If .HasText Then .AutoSize = ppAutoSizeShapeToFitText
End With
End Sub