ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   GetDirectory Function (https://www.excelbanter.com/excel-programming/297987-getdirectory-function.html)

todd

GetDirectory Function
 
Function GetDirectory(InitDir As String, Flags As Long,
CntrDlg As Boolean, Msg) As String
Dim bInfo As BROWSEINFO
Dim pidl As Long, lpInitDir As Long

CntrDialog = CntrDlg ''Copy dialog centering setting
to module level variable so callback function can see it
With bInfo
.pidlRoot = 0 'Root folder = Desktop
.lpszTitle = Msg
.ulFlags = Flags

Above is only part of a function I got from a website long
ago. Does anyone know what I need to use to get it to
open the file dialog up at any other location other than 0
or root folder?

Thanks

Chip Pearson

GetDirectory Function
 
Todd,

See http://www.cpearson.com/excel/BrowseFolder.htm for details on
using the "Windows Shell Controls And Automation" library
functions to do this.



"Todd" wrote in message
...
Function GetDirectory(InitDir As String, Flags As Long,
CntrDlg As Boolean, Msg) As String
Dim bInfo As BROWSEINFO
Dim pidl As Long, lpInitDir As Long

CntrDialog = CntrDlg ''Copy dialog centering setting
to module level variable so callback function can see it
With bInfo
.pidlRoot = 0 'Root folder = Desktop
.lpszTitle = Msg
.ulFlags = Flags

Above is only part of a function I got from a website long
ago. Does anyone know what I need to use to get it to
open the file dialog up at any other location other than 0
or root folder?

Thanks




Todd Huttenstine[_3_]

GetDirectory Function
 
Hey thank you. That is very helpful.
"Chip Pearson" wrote in message
...
Todd,

See http://www.cpearson.com/excel/BrowseFolder.htm for details on
using the "Windows Shell Controls And Automation" library
functions to do this.



"Todd" wrote in message
...
Function GetDirectory(InitDir As String, Flags As Long,
CntrDlg As Boolean, Msg) As String
Dim bInfo As BROWSEINFO
Dim pidl As Long, lpInitDir As Long

CntrDialog = CntrDlg ''Copy dialog centering setting
to module level variable so callback function can see it
With bInfo
.pidlRoot = 0 'Root folder = Desktop
.lpszTitle = Msg
.ulFlags = Flags

Above is only part of a function I got from a website long
ago. Does anyone know what I need to use to get it to
open the file dialog up at any other location other than 0
or root folder?

Thanks







All times are GMT +1. The time now is 04:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com