Active Presentation

  • Thread starter Thread starter GS80
  • Start date Start date
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
 
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
 
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
 
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
 
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
 
Back
Top