Active Presentation

G

GS80

I think i must be doing something stupid here but hopefully someone will
point me in the right direction.

I'm using teh PowerPoint object model in a .Net app (C#) and am looking to
paste an image on the clip board to the application. The trouble i'm having
is setting the active presentation. Does anyone know how to do this? If i
activate the application object it launches powerpoint which is not what i
want to happen.

Its Office 2007 also.

Any help is greatfully appreciated,

G
 
S

Shyam Pillai

To set a presentation as active use:
If Application.Presentations(1).Windows.Count > 0 Then
'If presentation has a window open, activate it.
Application.Presentations(x).Windows(1).Activate
Else
'Else create a new window.
Application.Presentations(1).NewWindow
End If


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 
S

Shyam Pillai

Needed a correction.

To set a presentation as active use:
'X = index of the presentation you wish to activate.

If Application.Presentations(X).Windows.Count > 0 Then
'If presentation has a window open, activate it.
Application.Presentations(X).Windows(1).Activate
Else
'Else create a new window.
Application.Presentations(X).NewWindow
End If


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 
G

GS80

I seem to have it working now. Not sure why it was wasn't working initially.

With regards to the code that you supplied, would this not open up power
pointin a window? I didn't want to do this.

G
 
S

Shyam Pillai

This assumes that you have PowerPoint window open and hence you wish to
reference the activepresentation. When PowerPoint window is not visible then
ActivePresentation is nothing. In such a case you have to reference the
presentation using Presentations(X).


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 

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