drag 'n drop multiple png files

B

Bryan Harris

PowerPoint has this wonderful feature that allows you to drag and drop
a png file from the Finder into a presentation -- easy importing.

One problem, though, it only seems to allow you to drop one file at a
time. If you try to drop multiple files, only one of them makes it.
Why the limit? Is it a bug? Can I get around it?

TIA!

- Bryan
 
J

Jim Gordon

Hi Bryan,

I tried the drag 'n drop method in PPT 2001 and Version X with the same
result you experienced.

I'm flattered that TAJ suggestion my add-in, but it only puts one picture
onto each slide, so it won't help you much.

The best I can suggest is when you insert a new slide to choose the 4
picture slide layout and double-click each of the spots to add the pictures
to your slide. Your question does give me some ideas for a new version of
the add-in though.

-Jim Gordon
Mac MVP

All responses should be made to this newsgroup within the same thread.
Thanks.

About Microsoft MVPs:
http://www.mvps.org/

Search for help with the free Google search Excel add-in:
<http://www.rondebruin.nl/Google.htm>
 
T

TAJ Simmons

my add-in, but it only puts one picture
onto each slide, so it won't help you much.

Good point...I couldn't tell if Bryan wanted a picture per slide...or more
than one pic on the same slide. Good thinking though.

Cheers
TAJ
 
B

Bryan Harris

Good point...I couldn't tell if Bryan wanted a picture per slide...or more
than one pic on the same slide. Good thinking though.

Yes, I was hoping to drag 20 images all into 1 slide -- something of a
picture gallery. I do this quite often, so I was hoping there was a
magic keyboard shortcut to allow this...

- B
 
J

Jim Gordon

Hi Bryan,

Now I'm just picking your brain in case I want to include a feature like
this in a future version of my add-in (no promises!).

How do you arrange the images on the screen (rows & columns or some other
pattern? Are all the pictures the same size?

-Jim Gordon
Mac MVP

All responses should be made to this newsgroup within the same thread.
Thanks.

About Microsoft MVPs:
http://www.mvps.org/

Search for help with the free Google search Excel add-in:
<http://www.rondebruin.nl/Google.htm>
 
B

Bryan Harris

Now I'm just picking your brain in case I want to include a feature like
this in a future version of my add-in (no promises!).

Great, I'd definitely be interested (especially if the add-in works
under Windows too, then I'd have a better shot of getting the company
to spring for it...)
How do you arrange the images on the screen (rows & columns or some other
pattern? Are all the pictures the same size?

We do this VERY often, where we need to put a whole folder full of
400x400 images onto a single slide, resizing them in PowerPoint so
they'll fit. Today I need to place 160 images onto 8 slides, so
that's 20 per page.

I'd like to be able to specify the top left image location, the bottom
right image location (to allow for variable sized titles), the matrix
grid (5 cols x 4 rows), and the image width (1.25"). It'd be even
better if it would continue placing images onto the next slide using
the same parameters until it runs out of images.

I've tried doing this myself, but the VBA development environment for
PPT on the Mac is not very helpful. I can't figure out how to insert
even a single image from a file.

Definitely let me know if you decide to do it.

- Bryan
 
B

Bryan Harris

Okay, sorry Jim, you were too slow. =)

I now have the macro to populate slides with images (see below). It
works pretty well, but it has a few mildly painful limitations: 1) it
requires images to be square, 2) it requires the user to edit the
macro for each layout, 3) PowerPoint doesn't seem to want to read
files off nfs-mounted disks.

If anyone has any suggestions on how to rectify these, that'd be
great.

- Bryan

-------------------------


Sub showBounds()

' This routine will help you determine the values for the insertPics
routine

' Before running this, draw a rectangle as big as the area you want
your pictures
' to fill, select it, then run this macro.

myTop = ActiveWindow.Selection.ShapeRange(1).Top
myLeft = ActiveWindow.Selection.ShapeRange(1).Left
myBottom = myTop + ActiveWindow.Selection.ShapeRange(1).Height
myRight = myLeft + ActiveWindow.Selection.ShapeRange(1).Width

MsgBox "Your box is: top " & myTop & ", left: " & myLeft & ", bottom:
" & myBottom & ", myRight: " & myRight

End Sub


Sub insertPics()

' Inserts a folder full of .png files into PowerPoint
' NOTE: Assumes square images

' user edits these
myPath = "Ralph:Users:bh:Desktop:pngs"
myCols = 5
myRows = 4
myTop = 57.5
myLeft = 25.625
myBottom = 529.25
myRight = 687.375
myPad = 4 ' minimum pad between images

' ------------------------

Dim oPicture As Shape
Dim FullPath As String

imWidth = (myRight - myLeft - ((myCols - 1) * myPad)) / myCols
imHeight = (myBottom - myTop - ((myRows - 1) * myPad)) / myRows

If imWidth > imHeight Then
imSide = imHeight
Else
imSide = imWidth
End If

myHPad = ((myRight - myLeft) - (myCols * imSide)) / (myCols - 1)
myVPad = ((myBottom - myTop) - (myRows * imSide)) / (myRows - 1)

ActiveWindow.ViewType = ppViewSlide

With Application.FileFind
.SearchPath = myPath
.SearchSubFolders = True
.FileName = ".png"
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
curRow = 1
curCol = 1
curSlide = ActiveWindow.Selection.SlideRange.SlideNumber
FileList = ""
For i = 1 To .FoundFiles.Count
FullPath = .FoundFiles(i)
FileList = FileList & "Slide " & curSlide & " - " &
FullPath & Chr(13)
Set oPicture =
ActiveWindow.Selection.SlideRange.Shapes.AddPicture _
(FileName:=FullPath, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=myLeft + (curCol - 1) * (imSide + myHPad), _
Top:=myTop + (curRow - 1) * (imSide + myVPad), _
Width:=imSide, _
Height:=imSide)
oPicture.ZOrder msoSendToBack
curCol = curCol + 1
If curCol > myCols Then
curCol = 1
curRow = curRow + 1
If curRow > myRows And .FoundFiles.Count > i Then
curSlide = curSlide + 1
ActiveWindow.View.GotoSlide
Index:=ActivePresentation.Slides.Add(Index:=curSlide,
Layout:=ppLayoutBlank).SlideIndex
curRow = 1
End If
End If
Next i
curSlide = curSlide + 1
ActiveWindow.View.GotoSlide
Index:=ActivePresentation.Slides.Add(Index:=curSlide,
Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddTextbox _
(msoTextOrientationHorizontal, 57.5, 25.625, 471.75,
667.232).Select
ActiveWindow.Selection.TextRange.Text = FileList
ActiveWindow.Selection.TextRange.Font.Size = 10
Else
MsgBox "There were no files found."
End If
End With

Set oPicture = Nothing
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