Thread: MS Word Macro
View Single Post
 
Old 06-17-2015, 12:41 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,138
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