View Single Post
 
Old 11-22-2021, 06:35 AM
scienceguy scienceguy is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Feb 2019
Posts: 46
scienceguy is on a distinguished road
Default .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen)

Hello,

When I add the .InitialFileName for Application.FileDialog(msoFileDialogOpen), only part of the file is displayed. See screenshot attached. I've seen some solutions online, but I've yet to find one that works. Does anyone know a way around this, please? Here is my code:

Code:
Sub testOpen()

With Application.FileDialog(msoFileDialogOpen)
    .Filters.Clear
    .Filters.Add "Word Files", "*.doc*", 1
    .InitialFileName = "C:\Users\roy\OneDrive\Desktop\test_files\test_file_one.docm"
    If .Show = -1 Then
        strFile = .SelectedItems(1)
    End If
End With
If strFile = "" Then
    Exit Sub
End If

End Sub
Attached Images
File Type: png 2021-11-22.png (42.4 KB, 15 views)
Reply With Quote