LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Copy & paste image from UserForm (repost)

Yes Paul, you are right.
In what the first procedure doesn't give you satisfaction?
If it is the presence of the Office Clipboard, you can mask it afterwards
immediately.

Option Explicit
Private Declare Function _
OpenClipboard& Lib "user32" (ByVal hwnd&)
Private Declare Function _
EmptyClipboard& Lib "user32" ()
Private Declare Function _
SetClipboardData& Lib "user32" _
(ByVal wFormat&, ByVal hMem&)
Private Declare Function _
CloseClipboard& Lib "user32" ()

Private Sub CommandButton1_Click()
On Error Resume Next
Application.CommandBars.FindControl(1, 809).Execute
Dim hCopy&
OpenClipboard 0&: EmptyClipboard
hCopy = SetClipboardData(2, Me.Image1.Picture.handle)
CloseClipboard
Application.CommandBars.FindControl(1, 5746).Execute
' Test procedure
If hCopy Then PasteInWord
End Sub

Sub PasteInWord()
With CreateObject("Word.Application")
..Visible = True
..Documents.Add
..Selection.Paste
End With
End Sub

Regards,
MP


"Paul Martin" a écrit dans le message de news:
...
Hi Michel

Thanks, but the code at

<
http://msdn.microsoft.com/newsgroups...t.public.excel
..programming&mid=bedaf42e-e33b-44a4-97f0-b487be84a03d&sloc=en-us
appears to do the same as Atl-PrtScr, copying the UserForm. I want to
copy just the Image on the form, not the whole form.

Regards

Paul Martin
Melbourne, Australia





 
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
Copy and paste an image Bill Excel Discussion (Misc queries) 3 May 6th 10 12:29 PM
How to embed an image withon a cell as opossed to copy and paste Karla Rodriguez Charts and Charting in Excel 3 November 4th 05 03:01 PM
Copy & paste image from UserForm Michel Pierron Excel Programming 1 May 6th 05 02:29 AM
Copy image of UserForm to a clipboard Gabor Excel Programming 3 July 14th 04 10:39 PM
copy-paste in a userform Hatzipavlis Stratos Excel Programming 2 November 13th 03 10:24 AM


All times are GMT +1. The time now is 11:52 AM.

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

About Us

"It's about Microsoft Excel"