CanvasShapes.AddLabel Method
Creates a label. Returns a CanvasShapes object that represents the new label.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
Function AddLabel ( _
Orientation As MsoTextOrientation, _
Left As Single, _
Top As Single, _
Width As Single, _
Height As Single _
) As Shape
'Usage
Dim instance As CanvasShapes
Dim Orientation As MsoTextOrientation
Dim Left As Single
Dim Top As Single
Dim Width As Single
Dim Height As Single
Dim returnValue As Shape
returnValue = instance.AddLabel(Orientation, _
Left, Top, Width, Height)
Shape AddLabel(
MsoTextOrientation Orientation,
float Left,
float Top,
float Width,
float Height
)
Parameters
- Orientation
Type: Microsoft.Office.Core.MsoTextOrientation
The text orientation. Some of these constants may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
- Left
Type: System.Single
The position, measured in points, of the left edge of the label relative to the left edge of the slide.
- Top
Type: System.Single
The position, measured in points, of the top edge of the label relative to the top edge of the slide.
- Width
Type: System.Single
The width of the label, measured in points.
- Height
Type: System.Single
The height of the label, measured in points.
Return Value
Type: Microsoft.Office.Interop.PowerPoint.Shape
Shape
Examples
This example adds a vertical label that contains the text "Test Label" to myDocument.
Set myDocument = ActivePresentation.Slides(1)
myDocument.Shapes.AddLabel(Orientation:=msoTextOrientationVerticalFarEast, _
Left:=100, Top:=100, Width:=60, Height:=150).TextFrame _
.TextRange.Text = "Test Label"