Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 06-17-2015, 12:41 AM
gmayor's Avatar
gmayor gmayor is offline MS Word Macro Windows 7 64bit MS Word Macro Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

How about

Code:
Sub FixMargin()
Dim oDoc As Document
Dim oSection As Section
    Set oDoc = ActiveDocument
    If oDoc.Sections(1).PageSetup.PaperSize = wdPaperA4 Then
        For Each oSection In oDoc.Sections
            If oSection.PageSetup.Orientation = wdOrientLandscape Then
                oSection.PageSetup.LeftMargin = InchesToPoints(1.8)
            End If
        Next oSection
        oDoc.Save
    End If
lbl_Exit:
    Set oDoc = Nothing
    Set oSection = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 

Tags
macro, margins, pagesize



Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Word Macro Macro for MS Word ubns Word VBA 15 04-10-2012 04:37 PM
Macro in word khalfenadeem Word 1 04-11-2011 04:35 PM
MS Word Macro Help with Word macro please Philcraig69 Word VBA 2 01-21-2011 04:19 PM
Word 2003 macro to Word 2007 to 2010 to... maruapo Word VBA 0 06-04-2010 03:43 PM
Word macro weezypenguin Word 0 02-25-2010 01:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:04 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