|
|
|
|
|
|
Word
|
Default Page Setup Setter
|
|
Ease of Use
|
Easy
|
Version tested with
|
2000
|
Submitted by:
|
johnske
|
Description:
|
On opening a NEW Office Doc you're offered the option of "your usual page set-up?" on choosing YES - margins, font, view, etc are all changed and saved. If you choose NO the option is still available of running the set-up at any time thereafter.
|
Discussion:
|
You may be in a hurry and opt for the Office default page setup initially, but may later decide you want to use your usual setup - run the macro "SetupPage" and it shall be done.
|
Code:
|
instructions for use
|
Private Sub Document_New()
Dim Answer As VbMsgBoxResult
Answer = MsgBox("Do you want your usual page setup?", vbYesNo)
If Answer = vbNo Then Exit Sub Else SetupPage
End Sub
Sub SetupPage()
Application.WindowState = wdWindowStateNormal
ActiveDocument.ActiveWindow.View.Zoom.PageFit = wdPageFitBestFit
Set MyRange = Selection.Range
MyRange.WholeStory
MyRange.Font.Name = "Verdana"
With ActiveDocument.PageSetup
.Orientation = wdOrientPortrait
.TopMargin = InchesToPoints(0.6)
.BottomMargin = InchesToPoints(0.97)
.LeftMargin = InchesToPoints(0.6)
.RightMargin = InchesToPoints(0.6)
.PageWidth = InchesToPoints(8.27)
.PageHeight = InchesToPoints(11.69)
ActiveDocument.Save
End With
MsgBox ("All done - And saved! :o)")
End Sub
|
How to use:
|
- Open any Word doc on your PC:
- Select Tools/Macro/Visual Basic Editor
- In the VBE window, select View/Project Explorer
- In the Project Explorer pane, select Normal/Microsoft Word Object/ThisDocument
- Copy and paste the code in "ThisDocument"
- In the VBE window, select File/Close and Return To Microsoft Word
- Now select Tools/Macro/Macros/SetupPage/Run
- On opening any new office documents you will now be prompted with "Do you want your usual page setup?" (you choose)
|
Test the code:
|
- Type some text into a word doc using Times New Roman, select Tools/Macro/Macros/SetupPage/Run and watch for the changes to your text and page setup
- Go to Start/New Office Document/New document double-click and select Yes
|
Sample File:
|
No Attachment
|
Approved by Anne Troy
|
This entry has been viewed 105 times.
|
|