View Single Post
 
Old 04-08-2012, 10:28 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,383
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

You can get the page dimensions etc. with code like:
Code:
Sub GetPageDimensions()
' Define the variables
Dim Orientation As String, PageHeight As Single, PageWidth As Single
Dim MirrorMargins As Single, TopMargin As Single, BottomMargin As Single
Dim LeftMargin As Single, RightMargin As Single
With Selection.Sections.First.PageSetup
  If .Orientation = wdOrientPortrait Then
    Orientation = "Portrait"
  Else
    Orientation = "Landscape"
  End If
  PageHeight = .PageHeight
  PageWidth = .PageWidth
  MirrorMargins = .MirrorMargins
  TopMargin = .TopMargin
  BottomMargin = .BottomMargin
  LeftMargin = .LeftMargin
  RightMargin = .RightMargin
End With
' Inform the user
MsgBox "Orientation = " & Orientation & vbCr & _
  "PageHeight = " & PageHeight & vbCr & _
  "PageWidth = " & PageWidth & vbCr & _
  "MirrorMargins = " & MirrorMargins & vbCr & _
  "TopMargin = " & TopMargin & vbCr & _
  "BottomMargin = " & BottomMargin & vbCr & _
  "LeftMargin = " & LeftMargin & vbCr & _
  "RightMargin = " & RightMargin
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote