Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cant Create Image Edit Control in Access Form

Status
Not open for further replies.

miguelfc

Programmer
Aug 5, 2004
3
VE
Hi,

I've searched a lot and couldn't find an answer to my problem.

I want to have a field in my form that allow me to paste an image from the clipboard to, for example, a Paint field. Then, I want to save that image to a file on a specific folder in my computer via VB.

The reason for this is that I don't want to ask the user to open paint by himself and save the file, probably in the wrong location and with the wrong name.

The first approach was creating an OLE Object directly from the Insert menu and that worked partially. It allowed me to paste the image but there wasn't a way to save it to a file, neither a method for that. It was an incrusted object, and I think that is the reason for that.

Then I tried to create the object by myself via VB, with the instructions:
Code:
Dim objeto_perfil As Object
Set objeto_perfil = CreateObject("Paint.Picture") 'IT STOPS HERE
And with the variation:
Code:
Dim objeto_perfil As Object
Set objeto_perfil = CreateObject("Paint") 'IT STOPS HERE
And neither worked. The error message says it lacks an object.

Then I followed an example from msdn that used a bound frame (view here). The code is:

Code:
    visor_perfil.Class = "Paint.Picture" ' Set class name.
    ' Specify type of object.
    visor_perfil.OLETypeAllowed = acOLELinked
    ' Specify source file.
    visor_perfil.SourceDoc = "C:\RealPath\image.BMP"
    ' Create linked object.
    visor_perfil.Action = acOLECreateLink  'IT STOPS HERE
    ' Adjust control size.
    visor_perfil.SizeMode = acOLESizeZoom

It stops in the action assignation, an says "error 2753 there was an error trying to communicate with the OLE server".

I google a lot and could find much of the Paint.Picture Class.

Anyone has any ideas to overcome this issue? What am I doing wrong?

Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top