get a ref to PPA as Presentation object

E

Essam Salah

Dear All
I am developing a Power Point Add-in ; to insert some preformatted slides and shapes.

I have finished it as a presentation and saved it as ppa file.
I am getting an error saying that my PPA is not in the Presentations Collection

for clarity : my presentation was myAddin.ppt and saved as myAddin.ppa
when I want to insert a slide from it I used to do :

Presentations("myAddin.ppt").slides(1).copy
ActiveWindow.Presentation.Slides.Paste

and this works fine .. but after saving as PPA this code doesn't work and gives the error before.

I figured out that the ADD-in is not in the Presentations collection ;it is in the Addins Collection
But the Addin class does not provide a Presentation member or Slides Collection

So how to get a Reference for some Addin as a Presentation object ???

I checked the Docs again and found the following in the [Presentations Collection Object]
... but it didn't work with me !!
{{{
Remarks
The Presentations collection doesn't include open add-ins, which are a special kind of hidden presentation. You can, however, return a single open add-in if you know its file name. For example Presentations("oscar.ppa") will return the open add-in named "Oscar.ppa" as a Presentation object. However, it is recommended that the AddIns collection be used to return open add-ins.

}}}

Any advice or help is highly appreciated
Thanks in advance
 
J

Jonathan West

Hi Eseem,

You need to files

1. A PPA file containing your code
2. A POT file to act as the design template for your presentations.

The code in your PPA file needs to know where the POT file is, so that it
can create a new presentation based on it.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup


Dear All
I am developing a Power Point Add-in ; to insert some preformatted slides
and shapes.

I have finished it as a presentation and saved it as ppa file.
I am getting an error saying that my PPA is not in the Presentations
Collection

for clarity : my presentation was myAddin.ppt and saved as myAddin.ppa
when I want to insert a slide from it I used to do :

Presentations("myAddin.ppt").slides(1).copy
ActiveWindow.Presentation.Slides.Paste

and this works fine .. but after saving as PPA this code doesn't work and
gives the error before.

I figured out that the ADD-in is not in the Presentations collection ;it is
in the Addins Collection
But the Addin class does not provide a Presentation member or Slides
Collection

So how to get a Reference for some Addin as a Presentation object ???

I checked the Docs again and found the following in the [Presentations
Collection Object]
... but it didn't work with me !!
{{{
Remarks
The Presentations collection doesn't include open add-ins, which are a
special kind of hidden presentation. You can, however, return a single open
add-in if you know its file name. For example Presentations("oscar.ppa")
will return the open add-in named "Oscar.ppa" as a Presentation object.
However, it is recommended that the AddIns collection be used to return open
add-ins.

}}}

Any advice or help is highly appreciated
Thanks in advance
 
S

Steve Rindsberg

Presentations("myAddin.ppt").slides(1).copy
ActiveWindow.Presentation.Slides.Paste

and this works fine .. but after
saving as PPA this code doesn't work and gives the error before.

Addins don't contain slides and aren't part of the presentations collection, so
what you're trying to do won't work.

Jonathan's suggestion is one way around the problem (basing your presentations
on a known template (which can contain slide info).

Another is to distribute one or more PPT files (in a known location) and insert
slide(s) from them into your current presentation. Record a macro while you
manually use Insert, Slides, From File to get a start on the code you'll need
for this.


================================================
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.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