Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Range Object CopyPicture Method; Paste to MS Word

I am using

Selection.CopyPicture Appearance:=xlPrinter, Format:=xlPicture

I was thinking that this code would copy a worksheet as it looks when
printed from Excel. My worksheet when printed is nicely formatted and is
printed in landscape and is 3 pages long. When I use the code below, all it
does is past the range and crams the whole thing on one page in Word without
any landscape, page formatting, etc.

Any suggestions on how to really copy and past someting "as it looks when
you print it out on the printer"?

Thanks.

Marian

Sub pictureasprinted()

Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document

Range("A5:N113").Select
Selection.CopyPicture Appearance:=xlPrinter, Format:=xlPicture
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add ' create a new document

With wrdDoc
.Content.Paste
.SaveAs ("C:\Foldername\MyNewWordDoc5.doc")
.Close ' close the document

End With
wrdApp.Quit ' close the Word application
Set wrdDoc = Nothing
Set wrdApp = Nothing
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run-time error, method 'paste' of object - worksheet failed. Carl Excel Programming 1 March 29th 06 05:08 AM
Method 'Paste' of object '_Worksheet' failed markline Excel Discussion (Misc queries) 7 May 28th 05 05:02 AM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
Method 'Paste' of object '_worksheet' failed Greg Bloom Excel Programming 4 October 18th 04 06:19 PM
Copypicture method failed Kamal[_5_] Excel Programming 2 April 22nd 04 11:31 AM


All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"