I have a report generated by my access program. Each record in the report has a picture that is stored externally and referenced with a file path. I want to have a way for my users to copy the pictures so they can paste them into an email or document. Since the pictures are stored externally the copy function is not available from the right click context menu. Is there a way I can add in a button and use VBA to get the picture from the file path and place it in the clipboard?
相关问题
- Markdown to clipboard as rich text
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
- DoCmd.TransferSpreadsheet is not recognizing works
相关文章
- How to add clipboard support to Matplotlib figures
- Unregister a XLL in Excel (VBA)
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- How to disable changes in a cell using vba?
- MsgBox Yes/No Excel VBA
- Rounding up to nearest higher integer in VBA
- Deleting columns from a table with merged cells
You can try the steps detailed in http://support.microsoft.com/kb/210216 however from the same description of the article:
"Microsoft Access does not have a command that sends information to the Clipboard. To post information to the Clipboard, you need to define a Visual Basic for Applications function that calls several Microsoft Windows API functions. This article shows you how to create a function that copies text to the Clipboard. "
so if this answers yur question deppends on how comfy you are on creating functions and using APIs
You could add something like this to the Double-Click event for the image:
this will open it in the Windows Picture and Fax Viewer from where the user can copy and so on.
Well I figured out a decent work around. I found some code here http://access.mvps.org/access/api/api0042.htm. Since this code is intended to be used in a form I put a button in the report that opens a form and passes in the filepath of the image. Once the form is open it sets the image control to the passed in filepath. Then it executes the copy function and closes itself. This seems to work pretty well.