将字节数组图像插入Word VBA
我有一个字节数组中的图像(从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将字节数组写入临时文件,并将该文件作为图像加载到 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.