Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 11-05-2016, 10:52 PM
macropod's Avatar
macropod macropod is offline using several margin settings Windows 7 64bit using several margin settings Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The macro for that could be coded as:
Code:
Private Sub Document_New()
Application.ScreenUpdating = False
Dim sngWdth As Single, StrIn As String
StrIn = InputBox("Please specify a margin width, in decimal inches", "Margin Setup", "1.00")
If IsNumeric(StrIn) Then
  sngWdth = InchesToPoints(CSng(StrIn))
Else
  Exit Sub
End If
With ActiveDocument.PageSetup
  .LeftMargin = sngWdth
  .RightMargin = sngWdth
  .TopMargin = sngWdth
  .BottomMargin = sngWdth
End With
Application.ScreenUpdating = True
End Sub
To use it, start Word and press Alt-F11 to open the VBA Editor. On the left, you should see and entry named 'Normal' and, below that, and entry for 'Microsoft Word Objects' and, below that, an entry named 'ThisDocument'. Double-click on that and paste the above code into the main window. Done. If Word prompts you to save changes to the Normal template when next you exit Word, do so. From now on, entering a single value into the input box you'll get as a prompt every time you create a new document, your new document will get all-round margins with that value. As coded, the macro defaults to the standard 1.00in margins.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
using several margin settings Change a document to A4 with Left margin 1.5 from Letter size and 1.27 margin Reuven Word 1 12-03-2015 04:25 PM
using several margin settings Margin settings? Spassapparat Word 5 06-18-2013 08:02 AM
using several margin settings Top margin Chawton1810 Word 1 05-20-2012 07:26 PM
using several margin settings Can't get rid of Margin Markers and need to get rid of them APohlmeyer Word 1 12-21-2011 04:06 PM
top margin - different first page beanz Word 0 06-28-2006 06:32 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:17 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft