简体   繁体   English

为 Powerpoint 的每张幻灯片自动生成文本框中的文本

[英]Automating the text in a text box for each slide of a Powerpoint

So I have about 500 pictures on each slide of a powerpoint.所以我在一个PowerPoint的每张幻灯片上都有大约500张图片。 On the bottom corner of each slide I have a textbox.在每张幻灯片的底角,我有一个文本框。 In the textbox, I want the name of the picture typed out.在文本框中,我想输入图片的名称。 The name of the picture is the name of the image on the selection pane.图片的名称是选择窗格上图像的名称。 So instead of typing out the name of the image in each textbox manually, I would like to automate this process.因此,我不想手动在每个文本框中输入图像的名称,而是想自动化这个过程。

Is there a way to do this?有没有办法做到这一点? Is it possible to do this with VBA, and if so what would the code look like?是否可以使用 VBA 执行此操作,如果可以,代码会是什么样子?

@BigBen is right. @BigBen 是对的。 And yes, you can do it.是的,你可以做到。

You need to use the .Shape.Name and the TextFrame.TextRange.Text https://docs.microsoft.com/en-us/office/vba/api/PowerPoint.Shape.Name https://docs.microsoft.com/en-us/office/vba/api/powerpoint.textrange您需要使用.Shape.NameTextFrame.TextRange.Text https: //docs.microsoft.com/en-us/office/vba/api/PowerPoint.Shape.Name https: //docs.microsoft.com /en-us/office/vba/api/powerpoint.textrange

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM