将字节数组图像插入Word VBA

发布于 2024-09-12 07:49:50 字数 108 浏览 1 评论 0原文

我有一个字节数组中的图像(从 MySQL blob 列中读取它),我需要使用 VBA 和 MS Word 将其插入到文档中。我可以创建一个形状并使用 EnhMetaFileBits 来“重新水合”它吗?

I have an image in a byte array (read it in from a MySQL blob column) and I need to insert that into a document using VBA and MS Word. Can I create a shape and use EnhMetaFileBits to "re-hydrate" it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嗼ふ静 2024-09-19 07:49:50

您可以将字节数组写入临时文件,并将该文件作为图像加载到 Word 文档中。应该不难了解如何使用宏记录器在 VBA 中执行最后一步。

PS:我自己没有检查过,因为我这里只有Office XP,EnhMetaFileBits似乎是只读的。

You could write the byte array to a temporary file and load this file as an image into your word document. Should not be too hard to find out how to do this last step in VBA using the macro recorder.

P.S.: without having checked it myself, since I have only Office XP here, EnhMetaFileBits seems to be read-only.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文