Developer FAQs - Viewing DocumentsWelcome to Baarns Publishing's Word Developers FAQ section. If you develop in Microsoft Word using Word Basic, these tips are for you. Feel free to copy any of the code you find here and use in your development projects. |
How do I test for the current view, set a new view, then restore the view? |
|
| |
|
How do you tell if Word is in FullScreen View?
Keywords: FullScreen View
Re-Posted July 21, 1997
The following code segments demonstrate how to test to see if Word is in FullScreen mode and how to change it to FullScreen mode.
Sub MAIN
iRet = SetFullScreen(1) 'Change into FullScreen mode.
MsgBox Str$(IsFullScreen)
iRet = SetFullScreen(0) 'Change to normal window.
End Sub
Function IsFullScreen
Dim dlgWW2TOV As WW2_ToolsOptionsView
GetCurValues dlgWW2TOV
IsFullScreen = dlgWW2TOV.FullScreen <> 0
End Function
Function SetFullScreen(pSetting)
WW2_ToolsOptionsView .FullScreen = Abs(pSetting)
End Function
How do I test for the current view, set a new view, then restore the view?
Keywords: Test Set Restore View
Re-Posted July 21, 1997
The following functions retrieve the current view and set the view.
Sub MAIN
Sub MAIN
'Demonstrate GetView and SetView functions.
fView = GetView
'Macro environment
iRet = SetView(4)
'Do something ...
'Restore the view
iRet = SetView(fView)
End Sub
Function GetView
If IsMacro() Then
GetView = - 1
Else
If ViewNormal() Then
GetView = 0
ElseIf ViewOutline() Then
GetView = 1
ElseIf ViewPage() Then
GetView = 2
ElseIf ViewDraft() Then
GetView = 3
ElseIf ViewMasterDocument() Then
GetView = 4
ElseIf FilePrintPreview() Then
GetView = 5
Else
GetView = - 1
End If
End If
End Function
Function SetView(pSetting)
Select Case pSetting
Case 0 : ViewNormal
Case 1 : ViewOutline
Case 2 : ViewPage
Case 3 : ViewDraft
Case 4 : ViewMasterDocument
Case 5 : FilePrintPreview
Case Else
End Select
End Function
Back to the FAQ Table of Contents
Ultimate office automation: networked coffee. |
Copyright© 1996-1999, Baarns Consulting Group, Inc. - All rights reserved. |