Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Pictures cjohnson Excel Discussion (Misc queries) 2 April 2nd 08 07:00 PM
Inserting Pictures DamienO Excel Discussion (Misc queries) 2 October 31st 07 12:40 PM
Inserting Pictures Matthew[_2_] Excel Discussion (Misc queries) 3 July 14th 07 10:23 AM
How to export all chartobjects in a sheet to powerpoint (creating a new ppt file) as pictures? Gunnar Johansson Charts and Charting in Excel 1 May 9th 05 05:10 AM
inserting pictures Denny[_2_] Excel Programming 5 November 16th 04 01:49 AM


All times are GMT +1. The time now is 09:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"