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:
Expand|Select|Wrap|Line Numbers
- Dim objeto_perfil As Object
- Set objeto_perfil = CreateObject("Paint.Picture") 'IT STOPS HERE
Expand|Select|Wrap|Line Numbers
- Dim objeto_perfil As Object
- Set objeto_perfil = CreateObject("Paint") 'IT STOPS HERE
Then I followed an example from msdn that used a bound frame (view here). The code is:
Expand|Select|Wrap|Line Numbers
- 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
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!