我一直在努力修复超出幻灯片高度和宽度的表格内容。为了做到这一点,我尝试缩小表中的文本大小(如您在图片中所看到的,字体大小从14更改为9)。 我打算使用的另一种技术是通过减小高度(标记为蓝色)来消除表格每一行中多余的“白色/空白”。
请帮助我弄清自己的想法或任何信息以实现这一目标。
答案 0 :(得分:0)
这利用了PowerPoint永远不会将行高缩小到小于单元格中包含的文本高度的事实。它将不断缩小文本,直到表格适合幻灯片为止。
Sub CheckTableHeight()
Dim oSlide As Slide
Dim oShape As Shape
Dim oTable As Table
Dim Row&, Column&
For Each oSlide In ActivePresentation.Slides
For Each oShape In oSlide.Shapes
If oShape.HasTable Then
Set oTable = oShape.Table
Do Until oShape.Height + oShape.Top < ActivePresentation.PageSetup.SlideHeight
For Row& = 1 To oTable.Rows.Count
oTable.Rows(Row&).Height = 5
For Column& = 1 To oTable.Columns.Count
oTable.Cell(Row&, Column&).Shape.TextFrame2.TextRange.Font.Size = (oTable.Cell(Row&, Column&).Shape.TextFrame2.TextRange.Font.Size - 1)
Next Column&
Next Row&
Loop
End If
Next oShape
Next oSlide
End Sub