Hi David,

 

I don't believe the "my computer" has an associated directory, so you can't
pass it into the common file dialog as the initial directory.  I guess you
could use "c:\" as the initial directory; it's pretty general as directories
go, and the user can choose "my computer" from the dialog.  If you use the
"desktop" directory location, it actually doesn't have any subfolders, so it
wouldn't be a good place to start (the directories on the disk don't
correspond to the logical organization structure in the treeview control
which you use to navigate with in the file open dialog).

 

My code sample looks pretty much like yours, except I do allow them to start
in the We profile directory:

 

' UseForOpen, DialogTitle, InitialFileName, InitialDirectory, Filters,
FilterIndex,

' defaultExtension , Flags, ParentWindow

 

strFileName = CommonFileDialog(True, "Select VBS File to Convert to VBA",
"", clientInformation.ScriptPath, _

"VBS files,*.vbs", 1, ".vbs", _

cfdfFileMustExist + cfdfEnableDialogResizing + cfdfUseLongFileNames)

 

I believe beginning with Vista, the use explorer style attribute has no
effect.

 

Hth,

 

Chip

 

 

 

From: David [mailto:[email protected]] 
Sent: Monday, December 30, 2013 1:17 PM
To: [email protected]
Subject: Browsing for file, starting from "my Computer"

 

In my app, I need the user to pick a file, anywhere on his computer. My idea
was to use the CommonFileDialog instruction, built-in with the App
environment of Window-Eyes.

 

To get a pointer to the "my Computer" special folder of the current system,
I used the following line:

 

 Dim ComputerTree: ComputerTree = FS.GetAbsolutePathName( CreateObject(
"Shell.Application" ).Namespace( 17 ))

 

But this one, returns the following path:

    C:\Program Files\GW Micro\Window-Eyes\My Computer

 

A folder that does not exist, and definitely does not open right at the root
fo the computer. Using this return in the following line:

 

 Dim Filename: Filename = CommonFileDialog( True, "Find Your File",,
ComputerTree, "Any File (*.*),*.*", 1, "*.*", cfdfEnableDialogResizing
+cfdfUseExplorerStyleInterface +cfdfUseLongFileNames)

 

Sure, the Common File Dialog opens. But it opens in the User Profile Folder,
of Window-Eyes. 

 

Does anyone have a solution, for how to have the File Dialog open from the
bottom of "My Computer"? Will also do, if it opened right at the Desktop of
the current user. From here, the user will have to browse to the location of
his file. Since the file can litterally be placed anywhere on the actual
system, it is somehow silly to start deep down in the file hiracki - like in
the User Profile Folder of the screen reader.

 

Thanks for any feedback.

 

Any code samples are welcome as well.

 

Reply via email to