|
|
|
|
|
|
|
|
|
Word
|
Default Open View
|
|
|
Ease of Use
|
Easy
|
|
Version tested with
|
2000
|
|
Submitted by:
|
Anne Troy
|
|
Description:
|
Sets a desired view on open of documents, regardless of the view in which they were saved.
|
|
Discussion:
|
When you open Word documents, particularly from other people, they may open in Normal view or some other view that you don't prefer. This code opens ALL new and previously created files in Print Layout View (in '97, this is called Page Layout view). Document_Open in the normal.dot template is an event that occurs any time you open any document. Document_New in the normal.dot template is an event that occurs whenever you create a new document. Hence, this code does not open the Word application in the view that is coded, but will open documents and create new documents in the view that is coded.
|
|
Code:
|
instructions for use
|
'In the two SetView commands, change "wdPrintView" to any of the following views desired:
'wdNormalView, wdOutlineView, wdPrintPreview
Private Sub Document_New()
Call SetView (wdPrintView)
End Sub
Private Sub Document_Open()
Call SetView (wdPrintView)
End Sub
Private Sub SetView(ByVal iView As Integer)
With ActiveDocument.ActiveWindow
If .View.SplitSpecial = wdPaneNone Then
.ActivePane.View.Type = iView
.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
Else
.View.Type = iView
.View.Zoom.PageFit = wdPageFitBestFit
End If
End With
End Sub
|
|
How to use:
|
- Copy the code above.
- Open Word.
- Hit Alt+F11 to open the Visual Basic Editor (VBE).
- Double-click ThisDocument under Normal on the left-hand side.
- Paste the code into the right-hand code window.
- Hit the save diskette button.
- Close the VBE.
|
|
Test the code:
|
- Open any document, and it will be opened in your desired layout.
|
|
Sample File:
|
No Attachment
|
|
Approved by Anne Troy
|
|
This entry has been viewed 54 times.
|
|
|