AddTextbox Method

Microsoft Publisher Visual Basic

expression.AddTextbox(Orientation, Left, Top, Width, Height)

expression    Required. An expression that returns one of the objects in the Applies To list.

Orientation   Required PbTextOrientation. The orientation of the text box.

PbTextOrientation can be one of these PbTextOrientation constants.
pbTextOrientationHorizontal A horizontal text box for left-to-right languages.
pbTextOrientationMixed Not used for this method.
pbTextOrientationRightToLeft A horizontal text box for right-to-left languages. This value has no effect if a right-to-left language is not selected.
pbTextOrientationVerticalEastAsia A vertical text box for East Asian languages. If a non-East Asian language is selected, text appears rotated 90 degrees to the right.

Left   Required Variant. The position of the left edge of the shape representing the text box.

Top   Required Variant. The position of the top edge of the shape representing the text box.

Width   Required Variant. The width of the shape representing the text box.

Height   Required Variant. The height of the shape representing the text box.

Remarks

For the Left, Top, Width, and Height arguments, numeric values are evaluated in points; strings can be in any units supported by Microsoft Publisher (for example, "2.5 in").

Example

The following example adds a new horizontal text box to the first page of the active publication.

Dim shpTextBox As Shape

Set shpTextBox = ActiveDocument.Pages(1).Shapes.AddTextBox _
    (Orientation:=pbTextOrientationHorizontal, _
    Left:=144, Top:=144, _
    Width:=72, Height:=18)