通过嵌入 Excel 模板的文件以编程方式将图片设置为 powerpoint 背景
我正在通过 Excel 中的 vba 生成 PPT 演示文稿,一切正常,除了我被要求自动设置电源点的背景(这不会有太大问题),但这将通过一张图片来完成实际上嵌入在宏中,所以我没有物理路径来引用图片,而且Excel是根据用户输入动态生成的。
那么..有没有人实现了这一点:以编程方式从 vba excel 设置幻灯片背景,并将图片嵌入到工作表中?
谢谢!
I'm generating a PPT presentation through vba in excel, everything is working just fine except that Im being asked to automatically set background of the power point (which it wouldn't be much a problem) but this will be done with a picture that is actually embedded on the macro, so I dont have physical path to reference the picture, plus the excel is generated on the fly according to the user inputs.
so.. has anyone achieved this : Programmatically set a slide backrground from vba excel with a picture that is embedded on a sheet?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我了解,您想要在 vba 中设置幻灯片的背景(从 Excel 调用并不重要)。
假设您的路径位于 var 中:
您还必须使用从之前的代码构建的 PPT 对象来调整
ActivePresentation
。As far as i understand, you want to set the background of the slides in vba (it doesn't matter it is called from Excel).
Let's assume you have the path in a var:
You will also have to adapt
ActivePresentation
with the PPT object you built from your previous code.如果您找不到直接从内存中的图片设置背景的方法,可以将图片从 Excel 复制/粘贴到 PPT 演示文稿中的幻灯片母版中,然后将它们发送到后面,以便它们位于所有内容的后面。我认为,从用户的角度来看,效果几乎是相同的。
If you can't find a way to set the background directly from a picture in memory, what about copy/pasting the picture from Excel into the Slide Master(s) in your PPT presentation then sending them to the back so they sit behind everything. The effect would be nearly identical from the user's point of view, I think.