Wednesday, July 1, 2009

Insert multiple pictures into Powerpoint slides in less than 1 minutes!

Let say, if you want to put 100 pictures into PowerPoint, and each slide should only have 1 picture only, how will you do? Do you insert one by one? It will take at least half an hour or more.

Here I show you a way that can do it in less than 1 minutes!
Open PowerPoint.
 
Goto Tools Menu->Macro->Macros
 
Type Macro1
 
Press Create button.
 
Paste the following code:

Sub Macro1()
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog( _
Type:=msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
mleft = InputBox("x:")
mtop = InputBox("y:")
mwidth = InputBox("Width (Default=720):")
mheight = InputBox("Height (Default=540):")
If mleft = "" Then mleft = 0
If mtop = "" Then mtop = 0
If mwidth = "" Then mwidth = 720
If mheight = "" Then mheight = 540
n = 1
With dlgOpen
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
ActivePresentation.Slides.Add( _
Index:=n, _
Layout:=ppLayoutBlank).Select
ActiveWindow.Selection.SlideRange.Shapes.AddPicture( _
FileName:=vrtSelectedItem, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=mleft, _
Top:=mtop, _
Width:=mwidth, _
Height:=mheight).Select
n = n + 1
Next vrtSelectedItem
Else
End If
End With
Set dlgOpen = Nothing
End Sub
 
Return to PowerPoint.
 
Goto Tools Menu->Macro->Macros
 
Select Macro1 and press Run button.
 
Input the position of the picture, coordinate x
(Press Enter without typing anything will set x=0)
 
Input the position of the picture, coordinate y
(Press Enter without typing anything will set y=0)
 
Input width of the picture
(Press Enter without typing anything will set width=720)
 
Input height of the picture
(Press Enter without typing anything will set height=540)
 
Select the multiple files you want to insert and press OK button.
 
Done!

Add To Google BookmarksStumble ThisFav This With TechnoratiAdd To Del.icio.usDigg ThisAdd To RedditTwit ThisAdd To FacebookAdd To Yahoo

No comments:

Post a Comment

Hey Guys! Thanks for visiting my blog. Hope you enjoy reading. Just leave your comments if you think this post is a worth readable! Your valuable comments are always welcomed. Please don't spam! and No abusive language would be tolerated. I would moderate your feedback and then it would be published. If you have any query I will try to give feedback as soon as possible.