Hi, i have an excel doc that currently has some code to copy a selection and paste it into a word document... I set it all up on a windows machine but now need to use it on a apple mac and what a surprise, it doesn't work! after hours of googling and amending my code to work with apple i am almost there... the only thing i cant seem to find online is how to make the word document Landscape... this is the code i have for windows and what i have for mac... it doesn't like the orientation of the margin sizes. Can anyone help?
Windows Code:
Mac Code:
Windows Code:
VBA Code:
Dim objPrintWord, objPrintDoc As Object
Set objPrintWord = CreateObject("Word.Application")
Set objPrintDoc = objPrintWord.Documents.Add
With objPrintDoc.PageSetup
.Orientation = wdOrientLandscape
.TopMargin = CentimetersToPoints(1)
.BottomMargin = CentimetersToPoints(1)
.LeftMargin = CentimetersToPoints(1)
.RightMargin = CentimetersToPoints(1)
End With
Mac Code:
VBA Code:
Dim oWord As Object
Application.Wait (3)
Set oWord = CreateObject(Class:=("Word.application"))
oWord.Visible = True
oWord.Activate
Dim oDoc
Set oDoc = oWord.Documents.Add
With oDoc.PageSetup
.Orientation = wdOrientLandscape
.TopMargin = CentimetersToPoints(1)
.BottomMargin = CentimetersToPoints(1)
.LeftMargin = CentimetersToPoints(1)
.RightMargin = CentimetersToPoints(1)
End With