确定 powerpoint 文本框是否超过页面大小
Determining if a powerpoint text box is over the page size
我已经对此进行了一段时间的研究,但没有找到关于 Powerpoint VBA 是否可以确定对象(文本框或 table)是否超出范围的背景资料页面尺寸。
我试图管理的具体应用是当我将文本从 Excel 流入 PPT table 时,通过 find/replace 特定数据标记,我不知道文字的具体尺寸,所以我可能会溢出页面边界。
我也不能缩小文本,因为我必须保持字体大小的设计保真度。
我想尝试测量此溢出发生的时间并使用 VB 创建一个新页面,我可以在该页面上继续从 Excel.
发送我的文本
现在,我只是将页面模板限制为 15 行,然后手动调整 over/under 页面流。可能是我唯一的选择,但我想我会提出这个问题。
这应该让你开始:
Option Explicit
Sub TextboxCheck()
Dim shp As Shape
Dim sld As Slide
Dim sldHeight As Long
sldHeight = ActivePresentation.PageSetup.SlideHeight
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.Type = msoTextBox Then
If shp.Top + shp.Height > sldHeight Then
'Add your code here for moving the text to a new slide
End If
End If
Next shp
Next sld
End Sub
我已经对此进行了一段时间的研究,但没有找到关于 Powerpoint VBA 是否可以确定对象(文本框或 table)是否超出范围的背景资料页面尺寸。
我试图管理的具体应用是当我将文本从 Excel 流入 PPT table 时,通过 find/replace 特定数据标记,我不知道文字的具体尺寸,所以我可能会溢出页面边界。
我也不能缩小文本,因为我必须保持字体大小的设计保真度。
我想尝试测量此溢出发生的时间并使用 VB 创建一个新页面,我可以在该页面上继续从 Excel.
发送我的文本现在,我只是将页面模板限制为 15 行,然后手动调整 over/under 页面流。可能是我唯一的选择,但我想我会提出这个问题。
这应该让你开始:
Option Explicit
Sub TextboxCheck()
Dim shp As Shape
Dim sld As Slide
Dim sldHeight As Long
sldHeight = ActivePresentation.PageSetup.SlideHeight
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.Type = msoTextBox Then
If shp.Top + shp.Height > sldHeight Then
'Add your code here for moving the text to a new slide
End If
End If
Next shp
Next sld
End Sub