FormatDrawingObject

Syntax

FormatDrawingObject [.Tab = number] [, .FillColor = number or text] [, .LineColor = number or text] [, .FillPatternColor = number or text] [, .FillPattern = number or text] [, .LineType = number] [, .LineStyle = number] [, .LineWeight = number or text] [, .ArrowStyle = number] [, .ArrowWidth = number] [, .ArrowLength = number] [, .Shadow = number] [, .RoundCorners = number] [, .HorizontalPos = number or text] [, .HorizontalFrom = number] [, .VerticalPos = number or text] [, .VerticalFrom = number] [, .LockAnchor = number] [, .Height = number or text] [, .Width = number or text] [, .InternalMargin = number or text]

Remarks

Changes the fill color, line style, size, and position of the selected drawing object or objects. The arguments for the FormatDrawingObject statement correspond to the options in the Drawing Object dialog box (Format menu).

Argument

Explanation

.Tab

Specifies the tab to select when you display the Drawing Object dialog box with a Dialog or Dialog() instruction:

0 (zero) Fill tab

1 Line tab

2 Size And Position tab

.FillColor

Specifies a fill color. To specify a percentage of gray, double the percentage of gray you want and make it negative (for example, for
5 percent gray, specify –10; for 37.5 percent gray, specify –75). To specify a color, use a value between 1 and 16, as described in CharColor, where 0 (zero) indicates no color.

.LineColor

Specifies a line color. For values, see .FillColor.

.FillPatternColor

Specifies the pattern color. For values, see .FillColor.

.FillPattern

Specifies the fill pattern:

0 (zero) Sets both .FillColor and .FillPattern to "None."

1 through 25 Specifies an item in the Patterns box on the Fill tab: 1 corresponds to the first item ("None"), 2 to the second, and so on.


Argument

Explanation

.LineType

Specifies whether to show the line:

0 (zero) Hides the line; only the fill and the arrowheads (if any) show.

1 Shows the line defined by .LineColor, .LineStyle, and .LineWeight.

.LineStyle

Specifies a line style in the Style box on the Line tab, where 0 (zero) is the first item, 1 is the second item, and so on through 4.

.LineWeight

The line width, in points or a text measurement.

.ArrowStyle

Specifies the arrow style for a linear drawing object: 0 (zero) corresponds to the first item (no arrowheads) in the Style box under Arrow Head, 1 to the second item, and so on through 6.

.ArrowWidth

Specifies the width of the arrowhead for a linear drawing object:

0 (zero) Narrow

1 Medium

2 Thick

.ArrowLength

Specifies the length of the arrowhead for a linear drawing object:

0 (zero) Short

1 Medium

2 Long

.Shadow

If 1, applies a shadow effect to the drawing object.

.RoundCorners

If 1, rounds the corners of a rectangular drawing object.

.HorizontalPos

The distance, in points or a text measurement, between the reference point specified by .HorizontalFrom and the drawing object.

.HorizontalFrom

Specifies the reference point from which the horizontal position of the drawing object is measured:

0 (zero) Margin

1 Page

2 Column

.VerticalPos

The distance, in points or a text measurement, between the reference point specified by .VerticalFrom and the drawing object.

.VerticalFrom

Specifies the reference point from which the vertical position of the drawing object is measured:

0 (zero) Margin

1 Page

2 Paragraph


Argument

Explanation

.LockAnchor

If 1, the drawing-object anchor remains fixed when the associated drawing object is repositioned. A locked anchor cannot be repositioned.

.Height

The height of the drawing object, in points or a text measurement.

.Width

The width of the drawing object, in points or a text measurement.

.InternalMargin

A measurement, in twips (20 twips = 1 point) or a text measurement, for the internal margin within a text box or callout drawing object.


Example

This example moves the selected drawing object down 10 points and to the right 10 points, assuming that points is the current unit of measurement:


Dim dlg As FormatDrawingObject
GetCurValues dlg
dlg.HorizontalPos = Val(dlg.HorizontalPos) + 10
dlg.VerticalPos = Val(dlg.VerticalPos) + 10
FormatDrawingObject dlg

See Also

DrawAlign, DrawReshape, DrawSnapToGrid