M
muyBN
In the following code, I want to search for and open the most recent file
modified, but don't know how to write that particular line. Assistance will
be appreciated. Thanks.
strPath = [path name]
strFirstFile = ActiveDocument.name
With Selection
With Application.FileSearch
.NewSearch
.LookIn = strPath
.SearchSubFolders = False
.FileName = "*.csv"
.Execute (msoSortByLastModified)
intFiles = .FoundFiles.count
If .Execute(msoSortByLastModified, msoSortOrderAscending) > 0 Then
strFile = [last modifed file]
End If
End With
End With
Documents.Open (strPath & "\" & strFile), AddToRecentFiles:=True,
Format:=11
modified, but don't know how to write that particular line. Assistance will
be appreciated. Thanks.
strPath = [path name]
strFirstFile = ActiveDocument.name
With Selection
With Application.FileSearch
.NewSearch
.LookIn = strPath
.SearchSubFolders = False
.FileName = "*.csv"
.Execute (msoSortByLastModified)
intFiles = .FoundFiles.count
If .Execute(msoSortByLastModified, msoSortOrderAscending) > 0 Then
strFile = [last modifed file]
End If
End With
End With
Documents.Open (strPath & "\" & strFile), AddToRecentFiles:=True,
Format:=11