Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-22-2021, 06:35 AM
scienceguy scienceguy is offline .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Windows 10 .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Office 2019
Advanced Beginner
.InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen)
 
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, 13 views)
Reply With Quote
  #2  
Old 11-22-2021, 01:02 PM
Logit Logit is offline .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Windows 10 .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

I am unable to reproduce the error here.

Is the initial file name accurate ?
Does the initial file exist in the directory named in the code ?
Reply With Quote
  #3  
Old 11-22-2021, 01:20 PM
scienceguy scienceguy is offline .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Windows 10 .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Office 2019
Advanced Beginner
.InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen)
 
Join Date: Feb 2019
Posts: 46
scienceguy is on a distinguished road
Default

Hi Logit,

Interesting, you can't reproduce the error. The answer is "yes" to both of your questions.

Thanks,
Roy
Reply With Quote
  #4  
Old 11-22-2021, 01:27 PM
Logit Logit is offline .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Windows 10 .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Maybe someone else has an answer to the error. Sorry.
Reply With Quote
  #5  
Old 11-22-2021, 01:29 PM
scienceguy scienceguy is offline .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Windows 10 .InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Office 2019
Advanced Beginner
.InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen)
 
Join Date: Feb 2019
Posts: 46
scienceguy is on a distinguished road
Default

If it's a short file name, it will work, but if it's longer, such as the one in my example, it fails to show the entire name.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
are settings saved in application or in pst file dfride Outlook 0 04-13-2021 03:34 PM
.InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) I need an application to file and access files. Balliol Word 2 12-18-2020 06:54 PM
MS Word Error: This file is in use by another application or user conky Word 4 02-26-2019 09:21 AM
.InitialFileName not showing all of file name with Application.FileDialog(msoFileDialogOpen) Word 2007 , when I save a .doc or .docx file the file type is showing "Empty" Tomc29 Word 9 06-10-2015 03:04 AM
Opening a MS .dot file through ASP.Net application eljapo4 Word 0 09-14-2012 01:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:42 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft