I really should have edited this better before I posted it ... hopefully this
is clearer...
I'm working with PowerPoint 2007/2003 developing in C++.
I've written code to insert text into a PowerPoint presentation. The code
works, but in slide show mode the text is always black after being inserted.
I set the color property of the text, but it isn't immediately visible.
When I insert a second text string, the first one changes to have the
correct color that I applied to it. I can also get the right color to show
up if I
switch back and forth between slides in the running presentation.
This problem only happens in slide show mode, the code works fine in edit
mode.
Here's what I'm doing:
m_TextRangePtr->SetText(szText);
m_FontPtr->AttachDispatch(m_TextRangePtr->GetFont());
m_ColorPtr->AttachDispatch (m_FontPtr->GetColor());
m_ColorPtr->SetRgb(m_clrText);
m_ColorPtr->ReleaseDispatch();
m_FontPtr->ReleaseDispatch();
m_TextRangePtr->ReleaseDispatch();
To get some changes to appear during a slide show you need to force the slide to
refresh; the only way to do this is to use the .GoToSlide method of the slide
show window's View.
GoToSlide takes the SlideIndex of the slide you want to go to as a param ... in
this case, you want to go to the same slide as you're already on.
Welcome to PowerPoint. Wonderful sometimes. Weird always.
> I really should have edited this better before I posted it ... hopefully this
> is clearer...
[quoted text clipped - 22 lines]
> m_FontPtr->ReleaseDispatch();
> m_TextRangePtr->ReleaseDispatch();
==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/
PPTools add-ins for PowerPoint
http://www.pptools.com/
Nathanael - 30 Jun 2009 21:51 GMT
I wondered if that might turn out to be the case ...
Thanks for the confirmation.
> To get some changes to appear during a slide show you need to force the slide to
> refresh; the only way to do this is to use the .GoToSlide method of the slide
[quoted text clipped - 38 lines]
> PPTools add-ins for PowerPoint
> http://www.pptools.com/
Nathanael - 30 Jun 2009 22:29 GMT
So I gave this a try. It seems that if you call GoToSlide and tell it to go
to your current slide, it doesn't force a redraw. (I'm assuming this is an
intentional optimization by Microsoft.)
Are there any ways to 'force' PowerPoint to refresh/redraw the current slide?
Thanks!
> To get some changes to appear during a slide show you need to force the slide to
> refresh; the only way to do this is to use the .GoToSlide method of the slide
[quoted text clipped - 38 lines]
> PPTools add-ins for PowerPoint
> http://www.pptools.com/
Steve Rindsberg - 30 Jun 2009 23:39 GMT
> So I gave this a try. It seems that if you call GoToSlide and tell it to go
> to your current slide, it doesn't force a redraw. (I'm assuming this is an
> intentional optimization by Microsoft.)
No, quite the opposite. It *should* force a redraw, and does in VBA.
> Are there any ways to 'force' PowerPoint to refresh/redraw the current slide?
>
[quoted text clipped - 42 lines]
> > PPTools add-ins for PowerPoint
> > http://www.pptools.com/
==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/
PPTools add-ins for PowerPoint
http://www.pptools.com/