load image with picture from other slide

  • Thread starter Thread starter daMike
  • Start date Start date
D

daMike

Hello,

I have to load a picture (location: slide(2)) into an imagebox
(location: slide(1)). I usually use the statement:

Slide1.Image.Picture = LoadPicture(???????)

Does anybody know how to modify the parenthesis to make it work?

Thanks in advance!
daMike
 
I have to load a picture (location: slide(2)) into an imagebox
(location: slide(1)). I usually use the statement:

Slide1.Image.Picture = LoadPicture(???????)

Does anybody know how to modify the parenthesis to make it work?

I don't think you can, not directly. LoadPicture wants a filename, as I
recall. I think there's a way in VB of getting it from the clipboard as
well, but I don't believe that's implemented in VBA.

Your best bet might be to:

Figure out the size of the picture
Start a new presentation with one blank slide
Size it to be proportional to the picture
Copy and paste the picture into it and size the picture to fill the slide
Use the .Export method on the slide to save it to file as a bitmap of the
size/format you want

THEN slurp that puppy into your imagebox from the file you've created.
 
I've never needed to do this, but why not just copy & paste the image shape.

You would need to ...
1) identify the shape in the source slide
2) Copy it
3) Paste it into slide you want it in


Something like this:
(Set 'action setting' for picture in slide 2 to 'Dup2One' on mouse click.)

Sub Dup2One(oShp As Shape)
With ActivePresentation
Slides(2).Shapes(oShp.Name).Copy
Slides(1).Shapes.Paste
End With
End Sub

When this sub activates, it copies the image clicked on in slide 2 to slide
1. Obviously, you'll need to use different selection techniques, but this
gives you the idea.

B
 
Back
Top