Slidemaster refresh problem

K

kodexe

I posted this question in the VSTO forum but I was suggested to post here
instead as it was not a particular VSTO issue but related to Powerpoint.

I have a Powerpoint VSTO Add-in where I want to change a text in the active
presentation slidemaster. Changing the text works fine but it does not
refresh on the slide that is showing. In order for it to update I have to
change slide and go back to the original slide again. Is there a way to
programmaticaly refresh the slide? I have tried
'presentation.Windows[1].View.GotoSlide(currentSlideIndex)' but that doesn't
work. I use the following code to change the text:


presentation.SlideMaster.Shapes["ConfidentialTextBox"].TextFrame.TextRange.Text = value;


presentation.SlideMaster.CustomLayouts[1].Shapes["ConfidentialFirstTextBox"].TextFrame.TextRange.Text = value;



Refreshing should work even if there is only one slide in the presentation.

/Urban
 
J

John Wilson

My guess is Steve's method will work.

You could also try a reset of all slides maybe

Sub resetit()
Dim osld As Slide
For Each osld In ActivePresentation.Slides
ActiveWindow.View.GotoSlide (osld.SlideIndex)
CommandBars.ExecuteMso ("SlideReset")
Next osld
End Sub

This is only for 2007 but since I see Custom Layouts I guess that's what you
use.
--

john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html




Steve Rindsberg said:
I posted this question in the VSTO forum but I was suggested to post here
instead as it was not a particular VSTO issue but related to Powerpoint.

I have a Powerpoint VSTO Add-in where I want to change a text in the active
presentation slidemaster. Changing the text works fine but it does not
refresh on the slide that is showing. In order for it to update I have to
change slide and go back to the original slide again. Is there a way to
programmaticaly refresh the slide? I have tried
'presentation.Windows[1].View.GotoSlide(currentSlideIndex)' but that doesn't
work. I use the following code to change the text:

presentation.SlideMaster.Shapes["ConfidentialTextBox"].TextFrame.TextRange.Text = value;

presentation.SlideMaster.CustomLayouts[1].Shapes["ConfidentialFirstTextBox"].TextFrame.TextRange.Text = value;

Refreshing should work even if there is only one slide in the presentation.

You might try switching views; ie, switch to, say, notes view then back.
 
U

Urban Andersson

John Wilson said:
My guess is Steve's method will work.

You could also try a reset of all slides maybe

Sub resetit()
Dim osld As Slide
For Each osld In ActivePresentation.Slides
ActiveWindow.View.GotoSlide (osld.SlideIndex)
CommandBars.ExecuteMso ("SlideReset")
Next osld
End Sub

This is only for 2007 but since I see Custom Layouts I guess that's what you
use.
--

john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html




Steve Rindsberg said:
I posted this question in the VSTO forum but I was suggested to post here
instead as it was not a particular VSTO issue but related to Powerpoint.

I have a Powerpoint VSTO Add-in where I want to change a text in the active
presentation slidemaster. Changing the text works fine but it does not
refresh on the slide that is showing. In order for it to update I have to
change slide and go back to the original slide again. Is there a way to
programmaticaly refresh the slide? I have tried
'presentation.Windows[1].View.GotoSlide(currentSlideIndex)' but that doesn't
work. I use the following code to change the text:

presentation.SlideMaster.Shapes["ConfidentialTextBox"].TextFrame.TextRange.Text = value;

presentation.SlideMaster.CustomLayouts[1].Shapes["ConfidentialFirstTextBox"].TextFrame.TextRange.Text = value;

Refreshing should work even if there is only one slide in the presentation.

You might try switching views; ie, switch to, say, notes view then back.
Reseting the slide did work well. I was not sure how to switch views in VSTO
so I have only tried to reset the views. Thank you for the solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top