基于我的最后一个问题 https://stackoverflow.com/questions/14503054/change-the-image-of-an-image-shape我得到了正确的代码来更改形状的图像。
不幸的是,这不会更新活动演示文稿。如果我关闭演示文稿并重新启动它,图像就会更改,但更改应该是直接可见的。
这是我更改图像的代码:
ActivePresentation.SlideShowWindow.View.Slide.Shapes("SolutionA_Image").Fill.UserPicture ("D:\User\SolutionWrong.jpg")
我找到了一种更新演示文稿的方法,但这会让演示文稿闪烁。
ActivePresentation.SlideShowWindow.Height = ActivePresentation.SlideShowWindow.Height - 1
ActivePresentation.SlideShowWindow.Height = ActivePresentation.SlideShowWindow.Height + 1
Edit
我尝试按照建议刷新幻灯片here http://answers.microsoft.com/en-us/office/forum/office_2003-customize/clicking-twice-on-command-button/21792aa0-4bd0-44d2-ae19-5365fe41baeb,但这对我不起作用。
Dim lSlideIndex As Long
lSlideIndex = SlideShowWindows(1).View.CurrentShowPosition
SlideShowWindows(1).View.GotoSlide lSlideIndex
Edit 2
我上传了我的文件:Download http://privat.kapistatistik.de/ChangeImage.zip
最后我找到了我的答案这篇博文 http://www.pptalchemy.co.uk/PowerPoint_Screen%20_Refresh.html。这似乎是 PowerPoint 2007 中的一个错误。
此代码有助于修复该错误:
Dim osld As Slide
'get current slide
Set osld = ActivePresentation.SlideShowWindow.View.Slide
'the next line adds the empty textbox and refreshs the slide
osld.Shapes.AddTextbox msoTextOrientationHorizontal, 1, 1, 1, 1
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)