问题
Based on my last question I got the right code to change the image of an shape.
Unfortunatly, this does not update the active Presentation. If I close the presentation and restart it, the image is changed, but the change should be directly visible.
This is my code to change the image:
ActivePresentation.SlideShowWindow.View.Slide.Shapes("SolutionA_Image").Fill.UserPicture ("D:\User\SolutionWrong.jpg")
I found a way to update the presentation, but this lets the presentation flicker.
ActivePresentation.SlideShowWindow.Height = ActivePresentation.SlideShowWindow.Height - 1
ActivePresentation.SlideShowWindow.Height = ActivePresentation.SlideShowWindow.Height + 1
Edit
I tried refreshing the slide as proposed here, but this didn't worked for me.
Dim lSlideIndex As Long
lSlideIndex = SlideShowWindows(1).View.CurrentShowPosition
SlideShowWindows(1).View.GotoSlide lSlideIndex
Edit 2
I uploaded my file: Download
回答1:
In the end I found my answer in this blog post. It appears to be a bug in PowerPoint 2007.
This code helps to fix the bug:
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
回答2:
I found this bug in my Power Point as well, I add this line into the code and it fixes the bug
Application.SlideShowWindows(1).View.GotoSlide Me.SlideIndex
来源:https://stackoverflow.com/questions/14506324/how-to-refresh-the-active-slide-in-a-slide-show