WD2000: ActiveWindow.DisplayVerticalRuler Returns False When True Is Expected (209826)
The information in this article applies to:
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.
WORKAROUNDMicrosoft 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
REFERENCES
For more information about getting help with Visual Basic for Applications,
please see the following article in the Microsoft Knowledge Base:
226118 OFF2000: Programming Resources for Visual Basic for Applications
Modification Type: | Major | Last Reviewed: | 6/17/2005 |
---|
Keywords: | kbnofix kbprb KB209826 |
---|
|