如何使用vba在powerpoint中执行复制粘贴操作时保持文本格式?
在我的最后一个问题中“使用vba从powerpoint中的文本中查找数字?”,我做了一个代码&它工作得很好(感谢Tony Dallimore)。但在这个过程中,我遇到了一些意想不到的事情,例如:
- 如果我的文本框包含带有项目符号和符号的文本。子子弹。
- 如果它包含带有某种字体颜色的http链接。
然后运行我的代码后。它向我显示没有任何文本格式的数据,如上面指定的文本格式消失了。
现在我知道为什么会这样了。因为在我的代码中,我将所有文本收集到一个变量中然后执行action然后替换成ppt中的旧的。
所以我的问题是“有没有办法在文本框中运行代码,这样提到的问题就会得到解决?”
有关代码,请转到上一个问题。
谢谢
In my last question "Find number from text in powerpoint using vba?", I made a code & its working perfectly (thanks to Tony Dallimore). But in this process i am facing some unexpected things like :
- If my textbox contain text with bullets & sub bullets.
- If it contains http links with some font color.
Then after running my code. it shows me data without any text formatting like above specified text formatting is vanish.
Now i know why this happen. Because in my code i collect all text into one variable & then perform action and then replace it to the old one in ppt.
So my question "Is there any way to run code within the textbox, so mentioned problem will be solved?"
For code please go to the previous question.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更多的是提示而不是答案:
范围对象有一个“.duplicate”属性 - 它复制格式。看看这是否可以应用于您的场景。
例如。
创建一个新文档。以您满意的方式格式化第一段。然后:
新页面中的文本将按照以前的格式设置
more of a hint than an answer:
range objects have a ".duplicate" property - which copies the formatting. See if this can be applied to your scenario.
eg.
create a new document. Format the first paragraph in a way that pleases you. then:
the text in the new page will be formatted as before