需要用Excel图表替换word文档中的图像
有没有简单的方法可以使用VB将word文档中的图像替换为Excel图表,并保留所有格式细节,例如图像框架样式、文本换行、锚点等(因此图像只是模板中的占位符)文档)
is there any simple way to replace an image inside word-document with an excel chart using VB and preserving all of the format details such as image frame style, text wrap, anchor, etc. (thus the image is just a placeholder in a template document)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我是对的 - 没有合适的方法来替换图像。所以我替换了自动形状背景
图表(chart_name).导出路径 + "chart.gif", "GIF"
word_app.ActiveDocument.Shapes(autoshape_name).Fill.UserPicture 路径 + "chart.gif"
...仍然无法从 MS Word UI 设置“autoshape_name”。
所以我必须为它编写额外的宏。这很烦人
if i'm right - there is no decent way to replace an image. so i've replaced autoshape background
Charts(chart_name).Export path + "chart.gif", "GIF"
word_app.ActiveDocument.Shapes(autoshape_name).Fill.UserPicture path + "chart.gif"
...still, there is no way to set "autoshape_name" from MS Word UI.
so i must write additional macros for it. that's annoying