VBA code to change Word to Landscape

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
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi norman8823. It doesn't take too much Googling to find your answer with bonus points. HTH, Dave
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,174
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top