![]() |
|
#1
|
|||
|
|||
![]()
Hi,
I have list of file names in excel and all those files with some other unwanted files (images) are present in one folder. Is there any way i can write a command or macro to extract the files listed in excel from the folder into PowerPoint slides automatically ? and if there is a way to do that, can i also import these files with specific size ? best Deep This is cross posted here: http://www.vbaexpress.com/forum/showthread.php?t=45891 Last edited by JohnWilson; 04-09-2013 at 12:57 PM. Reason: cross post |
#2
|
|||
|
|||
![]()
When you post is several forums please say so! It stops people working on problems solved elsewhere.
You need really to give more detail (including how much you know!) Assuming the folder is at "C:\Pics\" (change the code to suit) AND the list of images starts at "A1" then "A2" etc Try this in PowerPoint (You will need to set a reference to Excel) Excel file must be open and active Sub Pic_Choose() Dim i As Integer Dim XLApp As Excel.Application Dim pptSlide As Slide Dim pptShape As Shape Dim strFolder As String strFolder = "C:\Pics\" ' change to suit Set XLApp = GetObject(Class:="Excel.application") Do Until IsEmpty(XLApp.Range("A1").Offset(i, 0)) Set pptSlide = ActivePresentation.Slides.Add(ActivePresentation.S lides.Count + 1, ppLayoutBlank) Set pptShape = pptSlide.Shapes.AddPicture(FileName:=strFolder & XLApp.Range("A1").Offset(i, 0), _ LinkToFile:=False, _ SaveWithDocument:=True, _ Left:=10, Top:=10, Width:=-1, Height:=-1) '-1 =True (original size) 'to change size pptShape.Width = 3 * 72 '=3 inches (72 points= 1 inch) i = i + 1 Loop End Sub |
![]() |
Tags |
automatic, images, import |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PowerPoint 2010 image quality puzzle | virginiasb | PowerPoint | 3 | 08-30-2012 05:22 AM |
Auto update image in a PowerPoint file | expert4knowledge | PowerPoint | 0 | 05-28-2012 06:04 PM |
URGENT!!! Powerpoint Image Formatting and Positioning Macro | mertulufi | PowerPoint | 5 | 12-20-2011 10:14 AM |
Powerpoint + paste in image with fixed width | erki | PowerPoint | 0 | 09-19-2010 11:23 PM |
![]() |
quantass | PowerPoint | 3 | 08-20-2010 01:01 AM |