2013-01-24 97 views
2

我希望能够通过单击我的用户窗体中的按钮来更改图像形状的图像。更改图像形状的图像

在互联网上我发现功能UserPicture,但图像保持不变。

Private Sub ChangeImage_Click() 
    ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Visible = True 

    ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Fill.UserPicture ("D:\User\Desktop\SolutionWrong.jpg") 
End Sub 

Private Sub HideImage_Click() 
    ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Visible = False 
End Sub 

当我点击HideImage按钮,形状变得不可见的,所以我对形状的选择似乎是正确的。

我也试过

ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Fill.UserPicture "D:\User\SolutionWrong.jpg" 

但这也不

编辑
当然我检查了路径的新形象工作,这是正确的。

+0

我刚测试它,它的工作原理......它是什么样的形状? –

+0

我通过从'insert'菜单中选择'picture'创建它 – Christopher

+2

啊不奇怪:)做到这一点。插入~~>一个无边框的矩形形状,现在试试:) –

回答

2

Siddharth Rout found the solution

我通过从insert菜单中选择picture创建的图像,但是它必须通过Insert =>Rectangular shape(无边界)创建。现在可以很容易地通过使用ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Fill.UserPicture ("D:\User\SolutionWrong.jpg")