掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
VBからのPowerPointのオブジェクト変更方法 (ID:75814)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
ぢゃわさん、ありがとうございました。無事解決いたしましたので、参考までに したにコードを乗せます。 Private Sub Command1_Click() Dim objppt As Object Dim newPres As Object Dim sld1Shapes As Object Dim sld2Shapes As Object Dim i As Integer 'オブジェクトの生成 Set objppt = New PowerPoint.Application '可視とする objppt.Visible = True 'パワーポイントオープン objppt.Presentations.Open "E:\Test_PowerPoint\Test.ppt" '*****背景色変更処理 'オブジェクトのセット 'With objppt.ActivePresentation 'Set sld1Shapes = .Slides(1).Shapes(1) 'Set sld2Shapes = .Slides(1).Shapes(2) 'End With '色変更 'With objppt.ActivePresentation '.Slides(1).Shapes(1).Fill.ForeColor.RGB = RGB(255, 0, 0) '.Slides(1).Shapes(2).Fill.ForeColor.RGB = RGB(128, 128, 0) 'End With ***** '表示中のスライドの図を全コピー objppt.ActivePresentation.Slides(1).Shapes.SelectAll objppt.ActivePresentation.Slides(1).Copy '新規スライドの作成 objppt.Presentations.Add WithWindow:=msoTrue objppt.ActivePresentation.Slides.Add 1, ppLayoutBlank '新規スライドのPresentation1への張り付け objppt.ActivePresentation.Slides(1).Select objppt.ActivePresentation.Slides(1).Shapes.Paste '名前を変えて保存 objppt.ActivePresentation.SaveAs _ filename:="E:\CopyALL_Test_PowerPoint\FileNameChange.ppt" objppt.ActivePresentation.Close 'オープンしている全プレゼンテーションのクローズ With objppt.Presentations For i = .Count To 1 Step -1 .Item(i).Close Next End With 'PowerPointの終了 objppt.Quit 'オブジェクトの開放 Set objppt = Nothing End Sub
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.