Copy Range then paste in word as BMP

politot

New Member
Joined
Nov 22, 2012
Messages
22
Hi Excel Guru..

I would like to ask a code on how to copy a range in excel then paste as bitmap in ms word? and if ever a next range has a value, the next range will be paste in a 2nd page of a Word?

Example:

Copy Range A1:U100 then Open a Word, then paste as bitmap.

Example 2:

Copy Range A1:U100 then Open a Word, then paste as bitmap.
create 2nd page in word, then Copy Range A101:U200 then paste in the existing word.

Many Thanks for your Help/Reply
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
see if this does the job for you:

Code:
Sub pstInWord()
Dim oWord As Word.Application
Dim oWordDoc As Word.document
Set oWord = New Word.Application
Dim rng1 As Excel.Range, rng2 As Excel.Range
With oWord
    .Visible = True
    Set oWordDoc = .Documents.Add(DocumentType:=wdNewBlankDocument)
End With
Set rng1 = Range("A1:U100")
Set rng2 = Range("A101:U200")
rng1.CopyPicture xlScreen, xlBitmap
With oWordDoc.Windows(1)
    .Selection.PasteSpecial Link:=False, DataType:=wdPasteBitmap, Placement:= _
                                            wdInLine, DisplayAsIcon:=False
    .Selection.InsertBreak wdPageBreak
    rng2.CopyPicture xlScreen, xlBitmap
    .Selection.PasteSpecial Link:=False, DataType:=wdPasteBitmap, Placement:= _
                                        wdInLine, DisplayAsIcon:=False

End With
Set oWord = Nothing
Set oWordDoc = Nothing
End Sub
 
Upvote 0

Forum statistics

Threads
1,225,681
Messages
6,186,411
Members
453,352
Latest member
OrionF

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