![]() |
Browsing For Files
I have added the following code to my form to open a browse dialog:
Dim oShell Dim oFolder Dim oFolderItem Dim strFilePath Set oShell = CreateObject("Shell.Application") Set oFolder = oShell.BrowseForFolder(0,"OpenFile",&H4000+&H0200) If not isnull(oFolder.Items.Item) then Set oFolderItem = oFolder.Items.Item End If This code opens a browse dialog but if I select a file it returns nothing but will return the path of a folder if I select it. What I want to be able to do is generate the full path to a file including the filename. Can anyone tell me how to do this please? Thanks |
Browsing For Files
According to the MSDN documentation on that method it only returns a folder,
not a file. You might try something like FindFiles. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "DavidW" wrote in message ... I have added the following code to my form to open a browse dialog: Dim oShell Dim oFolder Dim oFolderItem Dim strFilePath Set oShell = CreateObject("Shell.Application") Set oFolder = oShell.BrowseForFolder(0,"OpenFile",&H4000+&H0200) If not isnull(oFolder.Items.Item) then Set oFolderItem = oFolder.Items.Item End If This code opens a browse dialog but if I select a file it returns nothing but will return the path of a folder if I select it. What I want to be able to do is generate the full path to a file including the filename. Can anyone tell me how to do this please? Thanks |
All times are GMT +1. The time now is 08:00 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com