Paste Special (1 Viewer)

kitty77

Registered User.
Local time
Today, 09:51
Joined
May 27, 2019
Messages
232
I looking for an example of how to paste special as a picture into an OLE field. Basically, I'm copying to the clipboard a graph from a technical software. It needs to be pasted with the paste special not just paste.

I would like to have this code in a command button.
 

kitty77

Registered User.
Local time
Today, 09:51
Joined
May 27, 2019
Messages
232
Somewhat... found a workaround. Access does not like the paste (with my application / graph) but works with the paste special and select picture. So, was trying to find a way to automate that in a command button.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:51
Joined
Oct 29, 2018
Messages
11,199
Somewhat... found a workaround. Access does not like the paste (with my application / graph) but works with the paste special and select picture. So, was trying to find a way to automate that in a command button.
Oh, I see. Have you tried?
Code:
DoCmd.RunCommand acCmdPasteSpecial
 

kitty77

Registered User.
Local time
Today, 09:51
Joined
May 27, 2019
Messages
232
That works!!! How can I make it paste as a picture with code. Right now the dialog box comes up asking what type to paste. It will always be a picture for me. The first option.

Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:51
Joined
Oct 29, 2018
Messages
11,199
That works!!! How can I make it paste as a picture with code. Right now the dialog box comes up asking what type to paste. It will always be a picture for me. The first option.

Thanks.
Hi. You might have to use API for that. I'll look around...
 

kitty77

Registered User.
Local time
Today, 09:51
Joined
May 27, 2019
Messages
232
Does anyone know how to make the paste special dialog box not show? Default as picture?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:51
Joined
Oct 29, 2018
Messages
11,199
Does anyone know how to make the paste special dialog box not show? Default as picture?
I think it would have to be not by using the RunCommand method. More probably by using an API call of some sort.
 

kitty77

Registered User.
Local time
Today, 09:51
Joined
May 27, 2019
Messages
232
Not familiar with API. Can you show me an example?
Thanks...
 

kitty77

Registered User.
Local time
Today, 09:51
Joined
May 27, 2019
Messages
232
Does anyone know how to accomplish this? Paste Special without the dialog box? Paste as Picture
 

JHB

Have been here a while
Local time
Today, 15:51
Joined
Jun 17, 2012
Messages
7,720
Could you post your database with some sample data + name of the form in which the code runs.
 

kitty77

Registered User.
Local time
Today, 09:51
Joined
May 27, 2019
Messages
232
So, it is a form with a command button. Field name is Box
the graphic is already in the clipboard. The below works perfect but it brings up the dialog box too. Has to be a way to make that not appear and default as picture. Thanks.

Private Sub Command84_Click()
Me.Box.SetFocus
DoCmd.RunCommand acCmdPasteSpecial
End Sub
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:51
Joined
Oct 29, 2018
Messages
11,199
So, it is a form with a command button. Field name is Box
the graphic is already in the clipboard. The below works perfect but it brings up the dialog box too. Has to be a way to make that not appear and default as picture. Thanks.

Private Sub Command84_Click()
Me.Box.SetFocus
DoCmd.RunCommand acCmdPasteSpecial
End Sub
Hi. What type of control is "Box?"
 

kitty77

Registered User.
Local time
Today, 09:51
Joined
May 27, 2019
Messages
232
Does anyone know how I can accomplish this? Has to be a way.
Thanks!
 

Gasman

Enthusiastic Amateur
Local time
Today, 14:51
Joined
Sep 21, 2011
Messages
6,360
Could you use Sendkeys to select the default.?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:51
Joined
Oct 29, 2018
Messages
11,199
Does anyone know how I can accomplish this? Has to be a way.
Thanks!
Hi. Just FYI. I tried to duplicate your issue but couldn't. That's why I asked what type of control you were using.
 

kitty77

Registered User.
Local time
Today, 09:51
Joined
May 27, 2019
Messages
232
Maybe you could show me an example?

Thanks!
 

kitty77

Registered User.
Local time
Today, 09:51
Joined
May 27, 2019
Messages
232
I'm using this...

Private Sub Command84_Click()
Me.Spectra.SetFocus
DoCmd.RunCommand acCmdPasteSpecial
SendKeys "{Enter}", True
End Sub

The paste special dialog box still shows. And when I hit the enter button manually, nothing pastes.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom