MoveToolbar

Syntax

MoveToolbar Toolbar$, Dock, HorizPos, VertPos

Remarks

Moves the specified toolbar. If the specified toolbar is not displayed, an error occurs.

Argument

Explanation

Toolbar$

The name of the toolbar to move, as it is listed in the Toolbars dialog box (View menu).

Dock

Specifies whether to anchor the toolbar at the top, bottom, or either side of the Word window or to set it as a floating toolbar over the document window:

0 (zero) The toolbar floats over the document window.

1 The toolbar is anchored at the top of the Word window.

2 The toolbar is anchored at the left of the Word window.

3 The toolbar is anchored at the right of the Word window.

4 The toolbar is anchored at the bottom of the Word window.

HorizPos, VertPos

If Dock is 0 (zero), the horizontal (HorizPos) and vertical (VertPos) distance from the upper-left corner of the Word window to the upper-left corner of the toolbar, in pixels.

If Dock is nonzero, you must still specify HorizPos and VertPos. Word moves the toolbar to the nearest available position in the series of docked toolbars.


Example

This example displays the Forms toolbar and moves it to the lower-right corner of the Word window. The If conditional prevents the AppMaximize instruction from running and generating an error on the Macintosh.


If InStr(AppInfo$(1), "Macintosh") = 0 Then AppMaximize 1
ViewToolbars .Toolbar = "Forms", .Show
MoveToolbar "Forms", 0, 520, 410

See Also

ToolbarName$(), ToolbarState(), ViewToolbars