×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Images in ppt file

Images in ppt file

Images in ppt file

(OP)

Hi,

Maybe this will be useful for somebody. Lets suppose that you have a lot of images files (CATDrawings saved as jpg files for example) and you want to create a Microsoft presentation file. A quick way to create the ppt file is to use next macro in a blank presentation, with a blank landscape slide at start. Just create a folder named CATIA on C drive where you will put your image files (modify the macro if you have something else then jpg files or if you want to use another path) and copy-paste in VB editor in a new module what is written in the next rows. Be aware that the width and height of the slide is A0. After running the macro, you can open the My file.ppt saved in the same path (c:\CATIA\).



Sub INSERT()
'
' Macro by Ferdo
'


Set fs = Application.FileSearch

With fs

    .LookIn = "c:\CATIA\"
    .FileName = "*.JPG"
    
    If .Execute(SortBy:=msoSortByFileName, _
            SortOrder:=msoSortOrderDescending) > 0 Then

        For i = 1 To .FoundFiles.Count

  
 
    ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=2, Layout:=ppLayoutBlank).SlideIndex

    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:=.FoundFiles(i), LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=0, Top:=0, Width:=1189, Height:=841).Select
   

   
  Next
  
    End If
    
      End With
      
      ActiveWindow.View.Zoom = 60
      
          ActivePresentation.SaveAs FileName:="c:\CATIA\My file.ppt"
          
          ActiveWindow.Close
 
End Sub

Regards
Fernando

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources