Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-08-2012, 10:28 PM
macropod's Avatar
macropod macropod is offline Stretch image to fullpage macro Windows 7 64bit Stretch image to fullpage macro 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
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stretch image to fullpage macro Macro fails to add image border in Word 2007 samhdc Word 1 03-30-2012 04:56 AM
URGENT!!! Powerpoint Image Formatting and Positioning Macro mertulufi PowerPoint 5 12-20-2011 10:14 AM
How do I assign a macro to a button when the macro is in my personal workbook? foolios Excel Programming 2 07-27-2011 02:41 PM
Stretch image to fullpage macro Adding Image into a excel cell and adding a hyperlink to the image saravananiyyanar Excel 3 05-04-2011 08:31 AM
Background image vs. insert image lilaria PowerPoint 0 04-18-2011 08:45 AM

Other Forums: Access Forums

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