VBA 用于在文本溢出时缩小 PowerPoint 中的字体 [英] VBA for shrinking the font in PowerPoint when text overflows

查看:46
本文介绍了VBA 用于在文本溢出时缩小 PowerPoint 中的字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找出我在通过 CAT 工具进行语言转换后导出的 PowerPoint 文件的宏.在某些语言对中,由于语言长度的差异,翻译的内容将不适合源文件文本框.

因此,翻译和导出的 PowerPoint 文件包含多个形状/文本框,这些形状/文本框的某些内容超出了此类形状的可见区域.我想知道有什么方法可以让导出的 PPT 文件中所有形状/文本框中的新导出的文本内容在整个文件中全局缩小以适应这些形状的原始大小 - 仅适用于发生内容溢出时的那些形状.

我真正需要的是一个宏,如果文本高度/长度大于形状高度/长度,那么将字体大小降低 1 直到文本尺寸 = 形状尺寸.我在 MS Office 15 中工作.

感谢您的意见!

解决方案

您是否可以使用形状 TextRange 的 AutoSize 属性并让 PowerPoint 根据内容自动缩小文本,因为适合将取决于字体、大小和样式属性?您可以使用以下属性执行此操作:

oShp.TextFrame2.AutoSize = msoAutoSizeTextToFitShape

I'm trying to figure out a macros for PowerPoint files that I export after language conversion through a CAT tool. In some of the language pairs the translated content will not fit into the source file text boxes due to the differences in the language lengths.

Therefore, the translated and exported PowerPoint files contain multiple shapes/text boxes that have some content outside of the visible areas of such shapes. I was wondering what is way to get the newly exported textual content within all shapes/text boxes in the exported PPTs files shrunk globally throughout the file to fit the original sizes of those shapes - only for those shapes when a content overflow occurs.

All I really need is a macros with IF text height/length is more than shape height/length THEN lower font size by one until text dimensions = shape dimensions. I am working in MS Office 15.

Thank you for your input!

解决方案

Could you use the AutoSize property of the shape's TextRange and leave PowerPoint to automatically shrink the text based on the content because the fit will depend in the font face, size and style properties? You can do this with the following property:

oShp.TextFrame2.AutoSize = msoAutoSizeTextToFitShape

这篇关于VBA 用于在文本溢出时缩小 PowerPoint 中的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆