Vba 更改图像形状的图像

Vba 更改图像形状的图像,vba,powerpoint,Vba,Powerpoint,我希望能够通过单击我的用户表单中的按钮来更改图像形状的图像 在互联网上,我找到了功能UserPicture,但图像保持不变 Private Sub ChangeImage_Click() ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Visible = True ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Fill.Use

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

在互联网上,我找到了功能
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"
但这也不起作用

编辑
当然,我检查了新图像的路径,它是正确的。


我通过从
insert
菜单中选择
picture
创建了图像,但它必须通过
insert
=>
矩形
(无边框)创建。现在,通过使用
ActivePresentation.Slides(“Slide1”).Shapes(“SolutionA\u Image”).Fill.UserPicture(“D:\User\solutionError.jpg”)

我刚刚测试了它,它可以正常工作。。。它是什么形状?我通过从
insert
菜单中选择
picture
来创建它,难怪:)这样做。插入~~~>一个没有边框的矩形形状,现在试试:)它可以工作了!非常感谢你!您想将此作为答案发布吗?那我就可以接受了。没关系:)你可以回答你自己的问题并接受它(甚至是强烈推荐的)看这个…;)