Powerpoint presentation Index?

T

Trigger

I'm hoping this is possible in Powerpoint:

I'm running a VBscript multiple times concurrently to merge .ppt files
together into new presentations. I've got it running ok up to a
point, but because Powerpoint is a single instance application, all
these scripts need to keep track of which new/blank presentations they
idividually create (i.e. is it supposed to be writing to presentation1
or presentation2 etc.), otherwise they all just end up merging their
files into the active presentation.

Basically I need to get the index number of a new presentation
("currentPresentation") right after it is created:

Dim currentPresentation
PPTobj.Presentations.Add(True)
...insert method for --> currentPresentation = index of new
presentation
PPTobj.Presentations(currentPresentation).Slides.InsertFromFile
"somefile.ppt", 0

If anyone could help me out with this I would greatly appreciate it!

- Tristan
 
J

John Langhans [MSFT]

Hi Tristan,

While this is not an answer to your question, I am curious if you are
simply automating a solution that can be done manually (through the UI) or
whether the current UI for PowerPoint makes it impossible (or difficult) to
acheive your end result.

If you (or anyone else reading this message) have suggestions on how
PowerPoint can facilitate merging and reuse of slides/presentationsin the
future (perhaps without having to resort to VBA and/or add-ins), don't
forget to send your feedback to Microsoft at:

http://register.microsoft.com/mswish/suggestion.asp

As with all product suggestions, it's important that you not just state
your wish but also why it is important to you that your product suggestion
be implemented by Microsoft. Microsoft receives thousands of product
suggestions every day and we read each one but, in any given product
development cycle, there are only sufficient resources to address the ones
that are most important to our customers so take the extra time to state
your case as clearly and completely as possible.

IMPORTANT: Each submission should be a single suggestion (not a list of
suggestions)

John Langhans

Supportability Program Manager
Microsoft Office PowerPoint for Windows
Microsoft Office Picture Manager for Windows

This posting is provided "AS IS" with no warranties, and confers no rights.

Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
B

B

You do not need the actual presentation index, you can substitute the
presentation name instead.

For example:
MsgBox Application.Presentations(ActivePresentation.Name).FullName

Will give you the files saved address. So my solution if I had to work from
within VBA would be to create an array of file names in a simple external
txt file. But that's just my off-the-cuff thought.

A better way that I can see doing what I think you are doing, would be to
use VB6 externally to browse and collect all the information from the PPT
files, then maybe build the index presentation last. Be careful of the max
hyperlink address limit. PowerPoint does not have unlimited room for
storing hyperlinks. It keeps the hyperlink addresses in a kitchen junk
drawer type of area. From what I have read, there are several things that
are tossed into this 64 kb drawer. Once that is filled, PP does
unpredictable things with hyperlinks.

B
===============
Please spend a few minutes checking out www.pptfaq.com This link will
answer most of our questions, before you think to ask them.

Change org to com to defuse anti-spam, ant-virus, anti-nuisance
misdirection.
 
T

Trigger

Thank you for your feedback! Your suggestion worked!

What I'm actually doing is creating a back-end for a web interface
that will allow users to select the ppt files of their choice and then
download them as ONE presentation. My script will automatically merge
the selected files in the background and return the newly created
presentation.

Interrestingly enough, as a .vbs file the script now runs perfectly
(I've tested up to TEN instances running at the same time), however as
an asp I get an activeX error when then script is called more than
once concurrently: ActiveX component cannot create object:
"powerpoint.application".

As Powerpoint is a single instance app. it would seem that a .vbs,
calling "set PPTobj = CreateObject("powerpoint.application")" simply
sets PPTobj to the current instance of PPT, or creates a new one if it
does not exist. The same script as an .asp however generates the
above error.

Any suggestions? I guess I'll have to see if its possible to do:

"if powerpoint.application does not exist
then CreateObject(etc etc...)
else set newPres = Current.powerpoint.application"

....or something like that.

Thanx again!

- Tristan
 
T

Trigger

Thanx for you reply John, its nice to know MS is listening to
developers using their platform. I really only have one request: Make
Powerpoint a multi-instance application. I'll submit my request in
detail to the link you provided below.

Tristan
 

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