C
christophercbrewster via OfficeKB.com
[The following problem is something that I thought was already working-- not
sure.] My code creates a reference in Word that, when clicked, displays the
named slide in Powerpoint. The system knows what Ppt file to look for, and it
first has to make sure that this file is the active presentation. But when it
finds the right presentation, the Activate command doesn't work. If a
different file is active, the "correct" slide (by number) is displayed but in
the wrong presentation. Here's some code, edited to show the pieces that are
relevant. The oPPT object is working correctly in other respects. I'd
appreciate if someone can suggest why the Activate command has no effect.
Set oPPT = GetObject(, "PowerPoint.Application")
...
For Each oPres In oPPT.Presentations ' Find the specified
open presentation
If oPres.Name = PptFileName Then ' If the pres is
found open...
oPPT.Presentations(PptFileName).Activate ' NO EFFECT: Activate
presentation
...
--
Christopher Brewster
Lockheed Martin, Eagan MN
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/200904/1
sure.] My code creates a reference in Word that, when clicked, displays the
named slide in Powerpoint. The system knows what Ppt file to look for, and it
first has to make sure that this file is the active presentation. But when it
finds the right presentation, the Activate command doesn't work. If a
different file is active, the "correct" slide (by number) is displayed but in
the wrong presentation. Here's some code, edited to show the pieces that are
relevant. The oPPT object is working correctly in other respects. I'd
appreciate if someone can suggest why the Activate command has no effect.
Set oPPT = GetObject(, "PowerPoint.Application")
...
For Each oPres In oPPT.Presentations ' Find the specified
open presentation
If oPres.Name = PptFileName Then ' If the pres is
found open...
oPPT.Presentations(PptFileName).Activate ' NO EFFECT: Activate
presentation
...
--
Christopher Brewster
Lockheed Martin, Eagan MN
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/200904/1