访问VBA映像副本 [英] Access VBA image copy

查看:92
本文介绍了访问VBA映像副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由访问程序生成的报告。报表中的每个记录都有一张图片,该图片存储在外部并带有文件路径引用。我想为用户提供一种复制图片的方式,以便他们可以将其粘贴到电子邮件或文档中。由于图片存储在外部,因此右键单击上下文菜单不提供复制功能。有没有一种方法可以添加按钮并使用VBA从文件路径获取图片并将其放置在剪贴板中?

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?

推荐答案

我想出了一个不错的解决方法。我在 http://access.mvps.org/access/api/api0042中找到了一些代码。 htm 。由于此代码旨在用于表单中,因此我在报表中放置了一个按钮,用于打开表单并传递图像的文件路径。表单打开后,它将图像控件设置为传入的文件路径。然后,它执行复制功能并关闭自身。这似乎工作得很好。

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.

这篇关于访问VBA映像副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆