パワーポイントで、タイトルの位置に
テキスト+数字 の形でFor文を使って作りたいです。
例)こんにちは1(スライド1枚目)
こんにちは2(スライド2枚目)
...といった形です。
よろしくお願いします。
気になる質問をクリップする
クリップした質問は、後からいつでもMYページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。

回答1件
0
ベストアンサー
質問のタイトルでは"一括変換"となっていますが、本文では"タイトルの位置に~作りたい"
となっているので、すでにあるタイトルを変更したいのか、ない状態から追加したいのか、
どちらかわからないですが、とりあえず、タイトルを追加する方向で実装していみました。
PowerPoint 2016で動作確認しました。
(参考)
vba
1Sub test() 2 Dim myPresentation As PowerPoint.Presentation 3 Dim mySlide As PowerPoint.Slide 4 Dim myShape As PowerPoint.Shape 5 Dim ii As Integer, jj As Integer 6 7 Set myPresentation = ActivePresentation 8 9 If myPresentation.Slides.Count = 1 Then 10 ' 表紙しかない場合は、終了 11 Exit Sub 12 End If 13 14 ' 表紙は飛ばす(ii=2) 15 For ii = 2 To myPresentation.Slides.Count 16 Set mySlide = myPresentation.Slides(ii) 17 18 ' テキストボックス追加 19 Set myShape = mySlide.Shapes.AddTextbox( _ 20 Orientation:=msoTextOrientationHorizontal, _ 21 Left:=66, Top:=28.75, Width:=828, Height:=104.375 _ 22 ) 23 ' タイトル文字設定 24 With myShape.TextFrame.TextRange 25 .Text = "Title (" & ii & "/" & myPresentation.Slides.Count & ")" 26 .Font.Bold = True 27 .Font.Size = 44 28 End With 29 30 ' スライド中のテキストボックスの内容を出力 31 For jj = 1 To mySlide.Shapes.Count 32 Set myShape = mySlide.Shapes(jj) 33 With myShape 34 If myShape.HasTextFrame = msoTrue Then 35 Debug.Print .Top & "," & _ 36 .Left & "," & _ 37 .Width & "," & _ 38 .Height & "," & _ 39 """" & myShape.TextFrame.TextRange.Text & """" 40 End If 41 End With 42 Next 43 44 Next 45End Sub
投稿2017/09/29 17:44
総合スコア201
あなたの回答
tips
太字
斜体
打ち消し線
見出し
引用テキストの挿入
コードの挿入
リンクの挿入
リストの挿入
番号リストの挿入
表の挿入
水平線の挿入
プレビュー
質問の解決につながる回答をしましょう。 サンプルコードなど、より具体的な説明があると質問者の理解の助けになります。 また、読む側のことを考えた、分かりやすい文章を心がけましょう。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。