Consulting

Results 1 to 5 of 5

Thread: Insert Slides from other presentation

  1. #1

    Insert Slides from other presentation

    Is there a way to insert slide from one presentation into another with VBA? I have a add in where user can create take 5 slides from a presentation of lets say 100 and make a new presentation with only those 5. Lets say now i wanted to add in 3 from another presenation. Is there any type of vba code that can help me do that?

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    This copies a slide from a closed workbook to the active one....
    [VBA]Sub Macro1()
    Presentations.Open FileName:="F:\Temp\1.ppt", ReadOnly:=msoFalse
    ActivePresentation.Slides(1).Copy
    With Application.Presentations("1.ppt")
    .Saved = True
    .Close
    End With
    ActiveWindow.View.Paste
    End Sub[/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Nice, thanks. One thing that I did was invoke the menu option Insert>Slides from Files and let the user work with that.

    Another question: Does anyone know how to access the browse button or funciton? For example in the islides from file men screen there is a browse button that allows you to pick a presentation but not open it right away. The file path is then shown in a text box. How can I access that operation

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    from the help files:
    [VBA]
    Sub ShowFileDialog()
    Dim dlgOpen As FileDialog
    Set dlgOpen = Application.FileDialog( _
    Type:=msoFileDialogOpen)
    With dlgOpen
    .AllowMultiSelect = True
    .Show
    End With
    End Sub
    [/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    nice..Am I able to pull the fie path of the file they choose to a text box? Sorta like how the browse works.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •