norman8823
New Member
- Joined
- Sep 7, 2017
- Messages
- 4
Hi,
Newbie here so apologize in advance.
I have the code below that copies an excel table into word, while cycling through data for each page.
How can I add code to change the page orientation in Word to Landscape?
Bonus points for code to launch Word application and open new document
Thanks!
Sub CopyALLtoWord()
Dim objWord, objDoc As Object
ActiveWindow.View = xlNormalView
Dim i As Integer
For i = 1 To ActiveWorkbook.Worksheets("CLO 1pager").Cells(3, 3)
Worksheets("CLO 1pager").Range("n5").Value = i
Range("N5").Select
Calculate
'
ThisWorkbook.Worksheets("CLO 1pager").Range("L12:AL77").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
'Select Word & paste
Set objWord = GetObject(, "Word.Application")
objWord.Selection.Paste
objWord.Selection.TypeParagraph
Next i
End Sub
Newbie here so apologize in advance.
I have the code below that copies an excel table into word, while cycling through data for each page.
How can I add code to change the page orientation in Word to Landscape?
Bonus points for code to launch Word application and open new document
Thanks!
Sub CopyALLtoWord()
Dim objWord, objDoc As Object
ActiveWindow.View = xlNormalView
Dim i As Integer
For i = 1 To ActiveWorkbook.Worksheets("CLO 1pager").Cells(3, 3)
Worksheets("CLO 1pager").Range("n5").Value = i
Range("N5").Select
Calculate
'
ThisWorkbook.Worksheets("CLO 1pager").Range("L12:AL77").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
'Select Word & paste
Set objWord = GetObject(, "Word.Application")
objWord.Selection.Paste
objWord.Selection.TypeParagraph
Next i
End Sub