VBA命令在TextFrame2中自动调整文本大小

时间:2014-02-25 15:38:15

标签: visual-studio-2010 vba powerpoint powerpoint-vba

我有以下代码段将幻灯片添加到Microsoft PowerPoint演示文稿的末尾并指定标题/副标题:

longSlideCount = ActivePresentation.Slides.Count

With ActivePresentation.Slides
    Set slideObject = .Add(longSlideCount + 1, ppLayoutTitle)
End With

' ------------------------------ make the main title ------------------------------------- '

slideObject.Shapes(1).TextFrame.TextRange.Text = "This is the Main Title Text"
slideObject.Shapes(2).TextFrame.TextRange.Text = "This is the SubTitle Text"

是否可以缩小/增长标题字符串中的文本以适合文本框架中的一行?

1 个答案:

答案 0 :(得分:0)

使用.Textframe2.Autosize = msoAutoSizeTextToFitShape