?
Solved

Delphi TPowerPointApplication Reference

Posted on 2007-11-30
9
Medium Priority
?
1,168 Views
Last Modified: 2012-08-13
Does anyone know where I can find decent documentation (or a tutorial) for Delphi's TPowerPointApplication component?

Despite a lot of searching I have found nothing that explains how to use it.

I want to write an application that can extract slides out of one presentation and put them into another one (without using the clipboard).
0
Comment
Question by:plumothy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 26

Accepted Solution

by:
EddieShipman earned 900 total points
ID: 20384101
This is the definitive Delphi Powerpoint automation "reference"
http://www.djpate.freeserve.co.uk/AutoPpt.htm

However, take note that the Powerpoint VB help file will ease your transition.
0
 

Assisted Solution

by:ShimaAlavi
ShimaAlavi earned 900 total points
ID: 20390939
Hi dear plumothy:
You can do this easily,VBA allows you to extact sub range of slides out of one presentation and put  them into another one , therefore you should use InsertFromFile method as below :
InsertFromFile( FileName, Index, SlideStart, SlideEnd ).
Parameters  Description :
FileName : The name of the file that contains the slides you want to insert.
Index : The index number of the Slide object in the specified Slides collection you want to insert the new slides after.
SlideStart :The index number of the first Slide object in the Slides collection in the file denoted by FileName.
SlideEnd : The index number of the last Slide object in the Slides collection in the file denoted by FileName.

This method return an integer value that repersents  the number of slides inserted.
procedure ExtractSlidesFrom(FileName: String; Index, SlideStart, SlideEnd : Integer);
var
  PP : OleVariant;
begin
  PP := CreateOleObject('PowerPoint.Application');
  PP := PP.ActivePresentation.Slides.InsertFromFile(FileName,Index,SlideStart,SlideEnd);
end;

Open in new window

0
 

Author Comment

by:plumothy
ID: 20391402
Thanks - that looks really useful (and is ridiculously easy)!

It's my own fault, but I should have made it clear that I need to extract the slides from a loaded presentation rather than from a ppt file on disk (but without using the clipboard).
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Expert Comment

by:ShimaAlavi
ID: 20392231
Dear Plumothy

You can use GetActiveOleObject function instead of CreateOleObject

0
 

Author Comment

by:plumothy
ID: 20394082
Thanks ShimaAlavi,

But won't that still get slides from a ppt file on disk?
0
 

Expert Comment

by:ShimaAlavi
ID: 20394277
Dear Plumothy

I believe  that there is no solution for your question. I suggest you save your file at first and after that do the work what I mentioned before. You can get the file path of the  presentation using ActivePresentation.Path which you intend to insert into active presentation and put the file path into ExtarctSldiesFrom method.
0
 
LVL 3

Assisted Solution

by:Mamouri
Mamouri earned 200 total points
ID: 20397368
Only PowerPoint method's for inserting slide from another presentation is InsertFromFile. This method didn't support inserting slides from an opened presentation.

I didn't think there is a direct way for inserting slides from an opened presentation. I recommend an indirect way for this issue. Create a new slide and insert an OLE Object using Slides.Shapes.AddObject and give the reference of the opened presentation which you want insert slide from.

I didn't check this issue and I'm not sure it's working. But I think it's worth to think over it. Maybe Shima could help more about this.

Also maybe you should consider Shima's Solution, more seriously. If I understand him/her correctly, she recommend to save the source presentation and use InsertFromFile method to insert an slide from loaded presentation.
0
 

Author Comment

by:plumothy
ID: 20401304
Thanks to all who have responded. I now have it partially solved - not perfect but good enough.

I would like to split the points as follows:
 - EddieShipman = 225 points (for directing to some decent documentation - which is what I actually asked for in my original question)
 - ShimaAlavi = 225 points (for suggestions that very nearly solved my problem)
 - Mamouri = 50 points (for expanding on a previous answer encouraging me to keep trying).

For the sake of completeness, here is where I have got to so far:
I am now connecting to the source presentation while it is running and using its FullName property to find where it is on disk. Then I create a new presentation and call InsertFromFile to get all the slides from the source presentation. Then I call Save for the new presentation.
It's not perfect because that does not bring over the master slide, but I will continue working on it and I am sure I will get there in the end!

Thanks again.
0
 

Author Closing Comment

by:plumothy
ID: 31411935
Great help - thanks to all the contributors
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month12 days, 3 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question