表題どおりですが、パワーポイント上に張り付けた表の文字サイズを変更させるのは、セル単位でないと出来ないのでしょうか?
下記のコードのようにセル単位であれば、文字サイズ変更はできるのですが、こんなまどろっこしいことはせず、表単位で一気に文字サイズ修正するか、または、せめて、行単位か、列単位で文字サイズを変更する方法は無いものなのでしょうか?
VBA
1Dim ppApp As New PowerPoint.Application 2Dim ppPrs As PowerPoint.Presentation 3Dim TargetTable As Table 4Dim r As Row, c As Cell, tr As TextRange 5 6'パワーポイントを開く 7Set ppPrs = ppApp.Presentations.Open("template.pptx") 8 9'エクセル上で指定範囲をコピー 10ActiveSheet.Range("B2:G34").Copy 11 12'パワーポイントに張り付け 13ppPrs.Slides(1).Shapes.PasteSpecial DataType:=0 14 15'張り付けたOLEオブジェクトをテーブルオブジェクトにセット 16Set TargetTable = ppPrs.Slides(1).Shapes(1).Table 17 18'全列をループ 19For Each r In TargetTable.Rows 20 '全行をループ 21 For Each c In r.Cells 22 '文字サイズ変更 23 c.Shape.TextFrame.TextRange.Font.Size = 10 24 Next 25Next
あなたの回答
tips
プレビュー