Hi,
I have some code which opens a file called "Presentation.pptx" then copies its slides onto an active ppt file.
Code:
Sub main()
Dim objPresentation As Presentation
Dim i As Integer
'open the target presentation
Set objPresentation = Presentations.Open("C:\Presentation.pptx")
For i = 1 To objPresentation.Slides.Count
objPresentation.Slides.Item(i).Copy
Presentations.Item(1).Slides.Paste
Next i
objPresentation.Close
End Sub
Is it possible to amend code so that the file which is opened is the one which "contains" the word "Presentation" in its title as opposed to be called Presentation.pptx?
For example file could be called PresentationB.pptx and still be opened.
Reason for this is that file name changes every week (but always contains word Presentation) so if we put in macro a fixed file name the macro may not be able to find it.
Thanks,
Nic
