change active window

T

theintern

I have some vba that runs some queries in access, opens up microsoft project,
does some stuff in project, and then opens up Powerpoint and does some stuff
there too. this is all possible because i've included the references, so i
can build this into just one module. the problem however is that my PP code
using the ActiveWindow.Presentation.Slides(1) command and at that time PP
isn't the active window. How do i specifically set the active window to be
PowerPoint?

thanks
Scott
 
G

Graham Mandeno

Hi Scott

You'd be better off asking this in a PowerPoint newsgroup.

I'm not familiar with the PPT object model, but if it's anything like Excel
the Application object will have an ActivePresentation property which
returns a reference to a Presentation object. I would advise you to use
PptApp.ActivePresentation.

Even better, you have presumably, earlier in you code, either opened an
existing presentation or created a new one. You should retain the object
reference returned by that operation:

Dim MyPres as PowerPoint.Presentation
Set MyPres = PptApp.Presentations.Add( ... )
or
Set MyPres = PptApp.Presentations.Open( ... )

Then...
MyPres.Slides(1)...
 
T

theintern

Thanks graham. Unfortunately, neither of these are working. it's all very
strange. i'll post in a PowerPoint forum and see what i can get.

Thanks
Scott

Graham Mandeno said:
Hi Scott

You'd be better off asking this in a PowerPoint newsgroup.

I'm not familiar with the PPT object model, but if it's anything like Excel
the Application object will have an ActivePresentation property which
returns a reference to a Presentation object. I would advise you to use
PptApp.ActivePresentation.

Even better, you have presumably, earlier in you code, either opened an
existing presentation or created a new one. You should retain the object
reference returned by that operation:

Dim MyPres as PowerPoint.Presentation
Set MyPres = PptApp.Presentations.Add( ... )
or
Set MyPres = PptApp.Presentations.Open( ... )

Then...
MyPres.Slides(1)...

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

theintern said:
I have some vba that runs some queries in access, opens up microsoft
project,
does some stuff in project, and then opens up Powerpoint and does some
stuff
there too. this is all possible because i've included the references, so
i
can build this into just one module. the problem however is that my PP
code
using the ActiveWindow.Presentation.Slides(1) command and at that time PP
isn't the active window. How do i specifically set the active window to
be
PowerPoint?

thanks
Scott
 

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