![]() |
|
#3
|
||||
|
||||
|
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 |
| Tags |
| macro, margins, pagesize |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
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 |
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 |