
'Convert the handle into an OLE IPicture interface. Private Declare PtrSafe Function CloseClipboard Lib "user32" () As Long Private Declare PtrSafe Function GetClipboardData Lib "user32" (ByVal wFormat As Integer) As Long Private Declare PtrSafe Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long Private Declare PtrSafe Function IsClipboardFormatAvailable Lib "user32" (ByVal wFormat As Integer) As Long 'Does the clipboard contain a bitmap/metafile? 'Declare a UDT to store the bitmap information 'Declare a UDT to store a GUID for the IPicture OLE Interface ' * Pause : Makes the program wait, to make sure proper screen capture takes place. ' * AltPrintScreen: Performs the automation of Alt + PrtScrn, for getting the Active Window. ' * SaveClip2Bit : The entry point for 'Saving' the Image, calls for PastePicture
#Ipicture msdn code
' * fnOLEError : Get the error text for an OLE error code ' * CreatePicture : Private function to convert a bitmap or metafile handle to an OLE reference ' * PastePicture : The entry point for 'Setting' the Image ' * to paste a picture of whatever is on the clipboard into a standard image control. ' * Set ImageControl.Image = PastePicture ' * to save this to a location on the Disc. ' * To use it, just copy this module into your project, then you can use: ' * discovered on MSDN, Access World Forum, VBForums. ' * The code in this module has been derived from a number of sources ' * The code requires a reference to the "OLE Automation" type library. ' * can also be assigned to (for example) and Image control on a userform. ' * This object is then saved to a location on the disc. ' * DESCRIPTION: Creates a standard Picture object from whatever is on the clipboard. ' * PAUL FRANCIS, 11 April 2013 - Putting all pieces togeather ' * LUTZ GENTKOW, 23 July 2011 - Alt + PrtScrn ' * G HUDSON, 5 April 2010 - Pause Function ' * STEPHEN BULLEN, 15 November 1998 - Original PastPicture code ' * Please leave any Trademarks or Credits in place. Hier der Code, der mir dabei geholfen hat: Vielen Dank schon mal im Voraus für Eure Mühe. Ich hoffe, Ihr habt eine Lösung für mich.

MsgBox "Clipboard don't contain a Bitmap.", vbCritical, "Error" If lngPointer 0 Then Set Paste_Picture = Create_Picture(lngCopy, 0&, PICTYPE_BITMAP)īyVal lngPicType As Long) As IPictureDispĭim udtPicInfo As PIC_DESC, udtID_IDispatch As GUIDĬall OleCreatePictureIndirect(udtPicInfo, udtID_IDispatch, 0&, objPicture) LngCopy = CopyImage(lngPointer, IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG) LngReturn = OpenClipboard(Application.hWnd) If IsClipboardFormatAvailable(CF_BITMAP) 0 Then Private Function Paste_Picture() As IPictureDispĭim lngReturn As Long, lngCopy As Long, lngPointer As Long Private Declare Function CloseClipboard Lib "user32.dll" () As Long Private Declare Function GetClipboardData Lib "user32.dll" ( _ Private Declare Function OpenClipboard Lib "user32.dll" ( _

Private Declare Function IsClipboardFormatAvailable Lib "user32.dll" ( _ Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" ( _ĭeclare Function CopyImage Lib "user32.dll" ( _ ĭie Schaltfläche die den Vorgang anstoßen soll heißt. Aber wie muss ich den für Access umschreiben ?ĭas Formular heißt und das Feld im Formular. Ich habe jetzt schon viel gegoogelt und dieser Ansatz aus dem Excel-Forum scheint mir am vielversprechendsten. Somit ist Speicherplatz in der DB kein Problem, das Bild kann also ruhig als OLE-Objekt eingefügt werden. Wie kann ich eine Grafik aus der Zwischenablage in ein Formular und somit auch in eine Tabelle einfügen ?Īus der Tabelle wird ein Bericht erzeugt, dieser wird später per Email versendet und der Datensatz dann wieder gelöscht. Ich muss mich leider schon wieder an Euch wenden und hoffe auf Hilfe.
