insert pictures by automation?

L

ljb

I need to insert various size jpg photos into PowerPoint by automation. Some
images are portrait and others are landscape and in varying sizes. Each
slide needs about 1" space at the bottom for a photo caption coming from
Access. I want the photos centered in the area above the caption and scaled
as large as will fit without changing the aspect ratio. I can read the image
length and width in pixels from the jpg file but how do I insert them into
the specific area? I'm currently using .addpicture to insert them.

thanks
LJB
 
L

ljb

ljb said:
I need to insert various size jpg photos into PowerPoint by automation. Some
images are portrait and others are landscape and in varying sizes. Each
slide needs about 1" space at the bottom for a photo caption coming from
Access. I want the photos centered in the area above the caption and scaled
as large as will fit without changing the aspect ratio. I can read the image
length and width in pixels from the jpg file but how do I insert them into
the specific area? I'm currently using .addpicture to insert them.

thanks
LJB
I have solved the problem.
1. convert the image width and height dimension from pixels to points. 1px =
0.75pt
2. read PowerPoint's page setup width and height in points
3. subtract 72 points (1") from page width to allow for caption area
4. discover image orientation by examining image width and height
5. scale the appropriate image dimension to match the appropriate page area
6. apply the same scale factor to the other image dimension
7. if the image is to be inserted portrait calculate the inserts location by
(page width - image width)/2 = X
 

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