?
Solved

Powerpoint API

Posted on 2003-03-10
4
Medium Priority
?
2,737 Views
Last Modified: 2012-08-13
I have a directory full of jpeg images.  I would like to write a small program that utilizes the Powerpoint API to create a new presentation and create a new slide with one image per slide.

Would anybody happen to have any example code they would like to share?

Thanks,
David
0
Comment
Question by:d_glenn
[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
  • 2
4 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 8109051
<Interesting! Listening..>
0
 
LVL 7

Accepted Solution

by:
Smallint earned 200 total points
ID: 8109677
Here's your example. Remember to add reference Microsoft Powerpoint.


Dim app As New PowerPoint.Application
Dim Presentation As PowerPoint.Presentation
Dim shape As PowerPoint.shape
Dim myDocument As PowerPoint.Slide

Set Presentation = app.Presentations.Add
Presentation.Slides.Add 1, ppLayoutBlank

Set myDocument = Presentation.Slides(1)
myDocument.Shapes.AddPicture "c:\Pic1.jpg", True, True, 100, 100, 70, 70

Presentation.Slides.Add 2, ppLayoutBlank
Set myDocument = Presentation.Slides(2)
myDocument.Shapes.AddPicture "c:\Pic2.jpg", True, True, 100, 100, 70, 70


Presentation.SaveAs "c:\MiFirstPPS.PPS"
Presentation.Close
app.Quit
Set app = Nothing

0
 
LVL 1

Author Comment

by:d_glenn
ID: 8114998
Thanks, I will give it a try when I get a few minutes.
0
 
LVL 1

Author Comment

by:d_glenn
ID: 8122848
Very cool!  Thanks a bunch!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

762 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