ScreenUpdating, ScreenUpdating()

Syntax

ScreenUpdating [On]

ScreenUpdating()

Remarks

The ScreenUpdating statement controls most display changes on the monitor while a macro is running. When screen updating is turned off, toolbars remain visible and Word still allows the macro to display or retrieve information using status bar prompts, input boxes, dialog boxes, or message boxes. You can increase the speed of some macros by preventing screen updates. Screen updating is restored when the macro finishes or when it stops after an error.

Argument

Explanation

On

Specifies whether to show screen updates:

0 (zero) The screen does not update while the macro is running.

1 The screen updates normally while the macro is running.

Omitted Toggles screen updating.


The ScreenUpdating() function returns the following values.

Value

Explanation

0 (zero)

Screen updating is turned off.

1

Screen updating is turned on.


Example

This example arranges document windows in three different ways. A ScreenUpdating statement is used to turn off screen updating while the windows are being arranged. When the windows are arranged, a ScreenRefresh statement displays them. Note that the instructions TileDocWindowsVertically and CascadeDocWindows call subroutines (not shown here) that tile and cascade document windows.


ScreenUpdating 0
TileDocWindowsVertically
ScreenRefresh
MsgBox "Windows are tiled vertically."
CascadeDocWindows
ScreenRefresh
MsgBox "Windows are cascaded."
WindowArrangeAll
ScreenUpdating 1
MsgBox "Windows are tiled horizontally."

See Also

ScreenRefresh