2017-03-16 7 views
1

私はpptの2つのセットを持っています。最初のセットは、スライド1のプレースホルダーシェイプを含むテンプレートです。もう1つのpptには、スライド1のイメージが含まれています。コピーして最初のpptのプレースホルダーに置き換えます。pptから別のpptに画像をコピー&ペーストする方法

私は下に述べた次のコードを実行すると、私はこのエラーMSGに

Compiled error: Method or data member not found

コードを取得:

Sub copySlide() 
Dim objPresentation As Presentation 

Set objPresentation = Presentations.Open("/path/slides.ppt") 

objPresentation.Slides.Item(1).Shapes("image_1").Copy 
Presentations.Item(1).Slides.Shapes("image_placeholder_1").Paste 

objPresentation.Close 
End Sub 

答えて

0

あなたは、単に貼り付け部にスライドを指定する必要があり、その後のチューニング画像の配置:

Sub copySlide() 
    Dim objPresentation As Presentation 
    Set objPresentation = Presentations.Open("/path/slides.ppt") 
    Dim PPShape As Object 

    objPresentation.Slides.Item(1).Shapes("image_1").Copy 
    Set PPShape = Presentations.Item(1).Slides(1).Shapes.Paste 

With PPShape 
    .Height = 100 
    'Place from bottom using : PPPres.PageSetup.SlideHeigth - .Height 
    .Top = PPPres.PageSetup.SlideHeigth - .Height - 10 
    .Width = 100 
    'Place from right using : PPPres.PageSetup.SlideWidth - .Width 
    .Left = PPPres.PageSetup.SlideWidth - .Width - 10 
End With 

    objPresentation.Close 
End Sub 
関連する問題