Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Powerpoint macro inserting pictures
I have a problem with this macro, I has been working for years, It inserts
pictures from a directory called import to a blank powerpoint. but the user changed OS to XP home. And it stopped working I thought this is an easy one just create "C:\My Documents\my pictures\import\" as the bin to drop the picture files in as it was, and It should work. It now works on my machine XP pro. Office 2000. But not on the users XP home Office 97. The macro does not like this line: .FileName = "*.*" If I put the file name in of one file then it works for that file As I say this is working fine on my machine, Any Ideas? Many Thanks Paul Sub insertpic() ' ' Macro recorded 24/10/2002 by Paul Johnson ' Set fs = Application.FileSearch With fs .LookIn = "C:\My Documents\my pictures\import\" .FileName = "*.*" If .Execute(SortBy:=msoSortByFileName, _ SortOrder:=msoSortOrderAscending) 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." For i = 1 To .FoundFiles.Count ' MsgBox .FoundFiles(i) ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutBlank).SlideIndex 'ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutTitle).SlideIndex ' ActivePresentation.Slides.Range.Select 'ActiveWindow.Selection.TextRange.Characters(Start :=1, Length:=0).Select ActiveWindow.Selection.SlideRange.Shapes.AddPictur e(FileName:=.FoundFiles(i), LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=40, Top:=40, Width:=346, Height:=277).Select With ActiveWindow.Selection.ShapeRange ' .ScaleWidth 1.23, msoFalse, msoScaleFromTopLeft ' .ScaleHeight 1.23, msoFalse, msoScaleFromTopLeft End With Next i Else MsgBox "There were no files found." End If End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting Pictures | Excel Discussion (Misc queries) | |||
Inserting Pictures | Excel Discussion (Misc queries) | |||
Inserting Pictures | Excel Discussion (Misc queries) | |||
How to export all chartobjects in a sheet to powerpoint (creating a new ppt file) as pictures? | Charts and Charting in Excel | |||
inserting pictures | Excel Programming |