Microsoft KB Archive/209826

= WD2000: ActiveWindow.DisplayVerticalRuler Returns False When True Is Expected =

Article ID: 209826

Article Last Modified on 6/17/2005

-

APPLIES TO


 * Microsoft Word 2000 Standard Edition

-



This article was previously published under Q209826



SYMPTOMS
When you use the ActiveWindow.DisplayVerticalRuler command in a Visual Basic for Applications procedure as a function to return the display state of the vertical ruler, you may receive False as a return value instead of True as expected.



CAUSE
The current view of the active window is not set to print layout.

This behavior is by design. To view the vertical ruler, the current view setting for the active window must be print layout. Because print layout is the only view in which the vertical ruler is available, the return value of False is correct.



WORKAROUND
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

To work around this behavior, you can check the current view state before setting or checking the display state of the vertical ruler, as in the following example:

Sub CheckVerticalRulerDisplayState With ActiveWindow If .View = wdPrintView Then .DisplayVerticalRuler = True MsgBox .DisplayVerticalRuler End If  End With End Sub

