I'm using the following code to copy Range("A1:H59") and place it into a word document for forwarding by email.
The code works well, except that the default margins in the word Doc mean that eveything comes out too small. (I think that my work is being "Scaled To Fit")
How do I manually set the margins in Word from Excel VBA code?
How for example do I set all the margins to be 0.7mm?
Many thanks
Mike
Sub WordEmail_Click()
Range("A7").Select
Dim wdApp As Object
Dim wd As Object
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Set wd = wdApp.Documents.Add
wdApp.Visible = True
Range("A1:H59").CopyPicture xlScreen, xlPicture
wd.Range.Paste
Application.DisplayAlerts = False
End Sub
The code works well, except that the default margins in the word Doc mean that eveything comes out too small. (I think that my work is being "Scaled To Fit")
How do I manually set the margins in Word from Excel VBA code?
How for example do I set all the margins to be 0.7mm?
Many thanks
Mike
Sub WordEmail_Click()
Range("A7").Select
Dim wdApp As Object
Dim wd As Object
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Set wd = wdApp.Documents.Add
wdApp.Visible = True
Range("A1:H59").CopyPicture xlScreen, xlPicture
wd.Range.Paste
Application.DisplayAlerts = False
End Sub