Hi people,
can u help me to I change Word to be Landscape
Thank you.
can u help me to I change Word to be Landscape
Code:
Sub CopyToWord()
Dim objWord As Object
Dim objDoc As Object
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add(Template:= _
"C:\XXX\Desktop\template.docx")
Set Ar = Worksheets("Sheet1").Range("A1:F" & Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row)
Ar.Copy
objDoc.Range.Paste
With objDoc
.PageSetup.Orientation = wdOrientLandscape
End With
objWord.Visible = True
Set objDoc = Nothing
Set objWord = Nothing
End Sub
Thank you.