Marco for pasting in word

M

Marco ESMACH

Hi,
I want to use a macro to copy many selected range from excel to word.
The ranges have different sizes and I paste as bitmap for a easy
correc pasting.
Questions:
how to set the page orientation "landscape"?
how to insert page break in .doc document?
how to insert many ranges? (with the attached code, only rnValue2 is
visible)


I start with this code:
------------------------------------------------------------------------
Sub copia()
Dim wApp As Object
Dim wDoc As Object
Dim rnValue As Range

Set rnValue1 = Range("utile!A2:K59")
Set rnValue2 = Range("utile!A60:K94")
Set wApp = CreateObject("Word.Application")

With wApp.Documents.Add()
rnValue1.Copy
..Content.PasteSpecial Link:=False, DataType:=wdPasteBitmap,
Placement:= _
wdFloatOverText, DisplayAsIcon:=False
rnValue2.Copy
..Content.PasteSpecial Link:=False, DataType:=wdPasteBitmap,
Placement:= _
wdFloatOverText, DisplayAsIcon:=False
Application.CutCopyMode = False
..SaveAs Filename:=ThisWorkbook.Path & "\riassunto.doc"
..Close
End With
wApp.Quit
End Sub
------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top