VBAの全くの素人です。
https://teratail.com/questions/12442こちらのサイトをみてPowerPointの結合のマクロを実行することができました。
複数の結合で、いろいろな背景色であったりデザインで一緒にコピーしたいのですが
わかりませんでした。以下のVBAにどのように入れたら良いでしょうか?
イメージとしては、PowerPointから新しいスライド→スライドの再利用→元の書式を保持するということを、自動化したいのです。
よろしくお願いします。
PowerPointの2013 windows8.1で実施しています。
PowerPointの VBA
1Sub 結合のマクロ() 2 Dim openFilePath As String 3 Dim fn As String 4 Dim f As Object 5 Dim FSO As Object 6 Set FSO = CreateObject("Scripting.FileSystemObject") 7 Dim myPtt As Presentation 8 9 'C:\Users\Windows User\Desktop\PowerPointのマクロ 10 Set myPtt = ActivePresentation 11 12 '検索フォルダ 13 openFilePath = "C:\Users\Windows User\Desktop\PowerPointの元" 14 15 'フォルダ内のファイルを取得 16 For Each f In FSO.GetFolder(openFilePath).Files 17 18 'ファイル名の取得 19 fn = f.Name 20 21 '拡張子 pptx で判別 22 If FSO.GetExtensionName(openFilePath & "\" & fn) = "pptx" Then 23 24 'コピー元ファイルを開く 25 Presentations.Open (openFilePath & "\" & fn) 26 27 With ActivePresentation 28 'コピー元から全スライドをコピー 29 Presentations(fn).Slides(1).Copy '←スライド1のみコピー。 30 'コピー元を閉じる 31 .Close 32 End With 33 34 'コピー先へ貼り付け 35 myPtt.Slides.Paste 36 37 End If 38 39 Next f 40 41 Set FSO = Nothing 42 43End Sub 44 45 46 47コード
回答1件
あなたの回答
tips
プレビュー