Forum Discussion

Murali539's avatar
Murali539
Copper Contributor
Apr 21, 2022

using Open File dialog in VBA

I am using vba code in MS Word [Office365].  When I display the Open File dialog for the user to select multiple files, it is not allowing me to select files from multiple folders..  I can however select multiple files from the same folder though.

Below is the code I have:

 

...

Set fd = Application.FileDialog(msoFileDialogFilePicker)
fd.AllowMultiSelect = True
...

 

  • In my tests, it is NOT possible to manually select files from multiple folders. So, not surprising that it cannot be done with code.

    What were you wanting to be done with the files?
    • Murali539's avatar
      Murali539
      Copper Contributor
      Thanks for your response Doug. I was helping my daughter to automate creating headers for about 150 Word documents. I am creating a list of files in a listbox and then process them one at a time.
      Maybe, I should let her select files in a folder, save them and then let her go to another folder and select more files. When she is all done, I can start processing. I recently retired after 46 years of IT and getting back to programming to keep myself busy. I am sure I will be facing challenges but at the same time learning new stuff. THANKS again for your response.

Share

Resources