![]() |
#2
|
|||
|
|||
![]()
You are starting to get into more complex programming!
This will open the first file whose name starts with "Presentation" in a folder. I wouldn't make the folder "C:\" and I would consider a different prefix than "Presentation" Here's the basic of finding a matching file name using the File Scripting Object (fso). Code:
Sub WildCard() Dim fso As Object Dim oFile As Object Dim oFolder As Object Dim FolderPath As String Dim opres As Presentation FolderPath = "C:\" Set fso = CreateObject("Scripting.FileSystemObject") Set oFolder = fso.GetFolder(FolderPath) For Each oFile In oFolder.Files If oFile.Name Like "Presentation*" Then Presentations.Open oFile.Path Exit For End If Next oFile End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jeffreybrown | Word VBA | 2 | 05-01-2016 06:05 PM |
Export calendar events from multiple calendars with specific title | rasmus | Outlook | 0 | 02-06-2015 01:58 AM |
![]() |
danielle | Word | 4 | 12-03-2014 07:47 AM |
![]() |
pemartins | Excel | 16 | 02-24-2014 11:39 PM |
![]() |
ingmar.s | Word | 3 | 10-08-2009 10:23 AM |