![]() |
|
#1
|
|||
|
|||
![]()
Hi,
I'm trying to record a macro which stretches an image to the fullpage size, now I tried this at first by checking what the papersize type is and then just googling what the dimensions are. However if I use the same macro on another pc, the papersize dimensions are different. Is there a way I can get the dimensions of the papersize? Thanks |
#2
|
||||
|
||||
![]()
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] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
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 |
![]() |
saravananiyyanar | Excel | 3 | 05-04-2011 08:31 AM |
Background image vs. insert image | lilaria | PowerPoint | 0 | 04-18-2011 08:45 AM |