auto insert photo using macro

T

theintern

I want to auto insert a photo using a macro. The deal is that a picture of
our schedule as a team is constantly being updated. So i need the macro to
re-insert this photo each time it is run.

Thanks
scott
 
T

theintern

This is what i got to work: edit it as desired for size, placement

Sub insertphoto()
Dim oSlide As Slide
Dim oPicture As Shape

'PICTURE 1
' Change slide index position to the first slide
ActiveWindow.View.GotoSlide 1

' Set oSlide to the first slide in the presentation.
Set oSlide = ActiveWindow.Presentation.Slides(1)

' Set oPicture to the picture file on your computer. Set Link To
' File to false, Save With Document to true, and place it in the
' upper left-hand corner of the slide, sized to 1 by 1 points.
Set oPicture = oSlide.Shapes.AddPicture("C:\Documents and
Settings\deckers\Desktop\ThreeWeeks.gif", _
msoFalse, msoTrue, 1, 1, 1, 1)
' Now scale the picture to full size, with "Relative to original
' picture size" set to true for both height and width.
oPicture.ScaleHeight 1, msoTrue
oPicture.ScaleWidth 1, msoTrue

' Move the picture to the center of the slide. Select it.
With ActivePresentation.PageSetup
oPicture.Select
End With
'Code from online help
With ActiveWindow.Selection.ShapeRange(1)
oPicture.LockAspectRatio = msoFalse
oPicture.Left = 0
oPicture.Top = 0
oPicture.Width = 720
End With

end sub
 

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