PC Review


Reply
Thread Tools Rate Thread

auto insert photo using macro

 
 
theintern
Guest
Posts: n/a
 
      9th Jul 2008
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
 
Reply With Quote
 
 
 
 
theintern
Guest
Posts: n/a
 
      9th Jul 2008
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


"theintern" wrote:

> 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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Macro: insert formula into first blank cell in column & auto bawpie Microsoft Excel Programming 2 22nd Dec 2009 12:26 PM
Macro auto insert/delete =?Utf-8?B?RXJpYw==?= Microsoft Excel Misc 3 12th Jun 2007 09:09 PM
Auto insert macro =?Utf-8?B?Q2l0eUd1eQ==?= Microsoft Excel Misc 4 5th Feb 2007 05:47 PM
how do I create a macro to auto insert rows? =?Utf-8?B?YWFzaGlzaA==?= Microsoft Excel Worksheet Functions 1 30th Jan 2006 11:49 PM
Auto insert html OR rtf sig based on format of message. macro ? add in ? Ryan Microsoft Outlook VBA Programming 2 20th Oct 2004 06:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:39 PM.