Inserting pictures on particular slides

G

Guest

I have 12 pictures that need to be inserted into slides. I have a template
presentation set up with headings, etc. I would like to write a macro that
imports the picture into a specific slide. I cannot do any kind of batch
import because I only need certain pictures from the folder for certain
presentations. Thanks in advance.
 
D

David M. Marcovitz

How will you know which pictures need to go into which slides?
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
G

Guest

The pictures are named 4AWasteTrends, 6NLFPMYTD, etc. I have many pics for
each machine and crew that we have here and I have to give a monthly
presentation giving basically the same but updated data over and over.

The pictures are created from excel charts. I wrote a macro to create the
chart and export it as a picture. i am trying to write a macro for
powerpoint to put particular pictures on previously labeled slides.

I tried links but it asks me to update every individual picture everytime
the file is opened. I can't auto update because the data changes and I need
to save individual month info.

I saved the files as pictures to keep file size down and I want to put the
named files on particular slides in a macro.
 
D

David M. Marcovitz

I'm not sure that you answered my question. What you want to do is
relatively easy with a macro if and only if you have a relatively easy
way of identifying which pictures go on which slides. For example, the
two picture names you listed both have numbers at the beginning. Do those
correspond to slide numbers for where the pictures would go? If so, it
would be easy to scan through the pictures in the folder looking for one
that starts with 1 and put it on slide 1 and then move on to 2, and so
on. If the names are kind of random, then it will be hard to get a macro
to read your mind. That is, you know what 6NLFPMYTD means, but can you
teach your computer to know which slide, if any, to put that picture on?
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
G

Guest

The numbers correspond to machine numbers here at our facility. I can change
the names of the slides if that makes the macro easier to read and write.
There are 12 slides in each presentation plus a cover slide. Some of the
pictures are specific to a presentation and some are used in multiple
presentations but would be on the same number slide in each presentation.
 
D

David M. Marcovitz

So, when you change the names of the slides, will it be easy to tell
which picture goes on which slide. All we need is to have some line of
code that says something like:

If slideName = pictureName Then

If we can write that line (or something like it, even if it is a bit more
complicated) that doesn't require human intelligence, you can do this. If
not,you can't.

Sorry to sound like a broken record, but this is really the bottom line
for whether this is possible or not. If it takes a human to decipher, it
can't be done. If there is a simple computer algorithm, then it can.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
D

David M. Marcovitz

OK. Now you can try to modify the code that batch imports pictures from a
folder at the PPT FAQ:

http://www.pptfaq.com/FAQ00352.htm

That should, at least, give you the basic code for inserting a picture
from a file. From there, if you actually have the right file name, it is
really easy, just cycling through each slide and doing something like
this:

Set oPic = oSld.Shapes.AddPicture(FileName:=strPath & strTemp, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=0, _
Top:=0, _
width:=100, _
height:=100)

where strPath is the path of the file and strTemp is the name of the
file.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.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