Browse for Folder

I have the API working from (http://www.mvps.org/access/api/api0002.htm). Can 
I make the Browse for folder dialog start at a particular folder or unc path 
such as \\prt02\projects\?

TIA
0
Utf
4/21/2010 5:58:02 PM
access.modulesdaovba 1670 articles. 0 followers. Follow

4 Replies
955 Views

Similar Articles

[PageSpeed] 9

Hi,

Here is the module code I wrote to do what you looking for...

'Begin ************************
Option Explicit
Option Private Module

Private Const BIF_STATUSTEXT                           As Long = &H4&
Private Const BIF_RETURNONLYFSDIRS                     As Long = 1
Private Const BIF_DONTGOBELOWDOMAIN                    As Long = 2
Private Const MAX_PATH                                 As Long = 260

Private Const WM_USER                                  As Long = &H400
Private Const BFFM_INITIALIZED                         As Long = 1
Private Const BFFM_SELCHANGED                          As Long = 2
Private Const BFFM_SETSTATUSTEXT                       As Long = (WM_USER + 
100)
Private Const BFFM_SETSELECTION                        As Long = (WM_USER + 
102)

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" 
(ByVal Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam 
As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As 
BROWSEINFO) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As 
Long, ByVal lpBuffer As String) As Long
Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal 
lpString1 As String, ByVal lpString2 As String) As Long

Private Type BROWSEINFO
    hwndOwner                                              As Long
    pIDLRoot                                           As Long
    pszDisplayName                                     As Long
    strWinTitle                                        As Long
    ulFlags                                            As Long
    lpfnCallback                                       As Long
    lParam                                             As Long
    iImage                                             As Long
End Type

Private m_strCurrentDirectory                          As String

Public Function SelectAnyFolder(ByVal WindowTitle As String, ByVal 
StartDirectory As String) As String
'---------------------------------------------------------------------------
' Procedure     : BrowseForFolder
' DateTime      : 14/09/2007
' Author        : jp.ambrosino (argyronet)
' Purpose       : Sélectionne un dossier dans l'arboresence de répertoires
'...........................................................................
' Parameters    : StartDirectory = #
'                 WindowTitle = Window title
' Return Codes  : String = Foldername
'...........................................................................
' Usage         : Example
'                 strPath = SelectAnyFolder("Select a folder from :", 
"C:\WINDOWS")
'...........................................................................
' Evolutions    : 21/04/2008 Updated for VB6  (JPA)
'---------------------------------------------------------------------------
Dim cFunctions                                         As New clsFunctions
Dim lngReturn                                          As Long
Dim strBufferData                                      As String
Dim tBI                                                As BROWSEINFO

    m_strCurrentDirectory = StartDirectory & vbNullChar
    With tBI
        .hwndOwner = 0
        .strWinTitle = lstrcat(WindowTitle, " ")
        .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN + 
BIF_STATUSTEXT
        .lpfnCallback = GetAddressOfFunction(AddressOf BrowseCallbackProc)   
 'get address of function.
    End With

    lngReturn = SHBrowseForFolder(tBI)
    If (lngReturn) Then
        strBufferData = Space(MAX_PATH)
        SHGetPathFromIDList lngReturn, strBufferData
        strBufferData = Left$(strBufferData, InStr(strBufferData, 
vbNullChar) - 1)
        SelectAnyFolder = cFunctions.AddDirSeparator(strBufferData)
    Else
        SelectAnyFolder = vbNullString
    End If
    Set cFunctions = Nothing
End Function


Private Function GetAddressOfFunction(Ptr As Long) As Long
'---------------------------------------------------------------------------
' Procedure     : GetAddressOfFunction
' DateTime      : 14/09/2007 14:52
' Author        : jp.ambrosino (argyronet)
' Purpose       : Retourne un pointeur de fonction
'...........................................................................
' Parameters    : Aucun
' Return Codes  : Long = Pointeur de la fonction
'---------------------------------------------------------------------------
    GetAddressOfFunction = Ptr
End Function


Private Function BrowseCallbackProc(ByVal Hwnd As Long, ByVal uMsg As Long, 
ByVal lp As Long, ByVal pData As Long) As Long
'---------------------------------------------------------------------------
' Procedure     : BrowseCallbackProc
' DateTime      : 14/09/2007
' Author        : jp.ambrosino (argyronet)
' Purpose       : Function de callback
'...........................................................................
' Parameters    : Aucun
' Return Codes  : Long = Callback du process
'---------------------------------------------------------------------------

Dim lngRet                                        As Long
Dim strBufferData                                 As String

    ' Prevent an error from propagating back into the calling process.
    On Error Resume Next
    Select Case uMsg

        Case BFFM_INITIALIZED
            Call SendMessage(Hwnd, BFFM_SETSELECTION, 1, 
m_strCurrentDirectory)

        Case BFFM_SELCHANGED
            strBufferData = Space(MAX_PATH)

            lngRet = SHGetPathFromIDList(lp, strBufferData)
            If lngRet = eApplicative Then
                Call SendMessage(Hwnd, BFFM_SETSTATUSTEXT, 0, strBufferData)
            End If

    End Select
    If Err <> 0 Then Err.Clear
    BrowseCallbackProc = 0
End Function

Sub TestToSee()
    MsgBox SelectAnyFolder("Your folder...", CurrentProject.Path)
End Sub

'End *************************

Regards,

-- 
Argy
Goto : http://argyronet.developpez.com/
Livres :
Créez des programmes avec Microsoft Access 2007 (ISBN 2742982442)
VBA pour Office 2007 (ISBN 2742983910) 



"Rob Hamlin" wrote:

> I have the API working from (http://www.mvps.org/access/api/api0002.htm). Can 
> I make the Browse for folder dialog start at a particular folder or unc path 
> such as \\prt02\projects\?
> 
> TIA
0
Utf
4/21/2010 7:05:01 PM
I get an error "User-Defined type not defined" in this line

Dim cFunctions                                         As New clsFunctions

Any Ideas

"Argyronet" wrote:

> Hi,
> 
> Here is the module code I wrote to do what you looking for...
> 
> 'Begin ************************
> Option Explicit
> Option Private Module
> 
> Private Const BIF_STATUSTEXT                           As Long = &H4&
> Private Const BIF_RETURNONLYFSDIRS                     As Long = 1
> Private Const BIF_DONTGOBELOWDOMAIN                    As Long = 2
> Private Const MAX_PATH                                 As Long = 260
> 
> Private Const WM_USER                                  As Long = &H400
> Private Const BFFM_INITIALIZED                         As Long = 1
> Private Const BFFM_SELCHANGED                          As Long = 2
> Private Const BFFM_SETSTATUSTEXT                       As Long = (WM_USER + 
> 100)
> Private Const BFFM_SETSELECTION                        As Long = (WM_USER + 
> 102)
> 
> Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" 
> (ByVal Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam 
> As String) As Long
> Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As 
> BROWSEINFO) As Long
> Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As 
> Long, ByVal lpBuffer As String) As Long
> Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal 
> lpString1 As String, ByVal lpString2 As String) As Long
> 
> Private Type BROWSEINFO
>     hwndOwner                                              As Long
>     pIDLRoot                                           As Long
>     pszDisplayName                                     As Long
>     strWinTitle                                        As Long
>     ulFlags                                            As Long
>     lpfnCallback                                       As Long
>     lParam                                             As Long
>     iImage                                             As Long
> End Type
> 
> Private m_strCurrentDirectory                          As String
> 
> Public Function SelectAnyFolder(ByVal WindowTitle As String, ByVal 
> StartDirectory As String) As String
> '---------------------------------------------------------------------------
> ' Procedure     : BrowseForFolder
> ' DateTime      : 14/09/2007
> ' Author        : jp.ambrosino (argyronet)
> ' Purpose       : Sélectionne un dossier dans l'arboresence de répertoires
> '...........................................................................
> ' Parameters    : StartDirectory = #
> '                 WindowTitle = Window title
> ' Return Codes  : String = Foldername
> '...........................................................................
> ' Usage         : Example
> '                 strPath = SelectAnyFolder("Select a folder from :", 
> "C:\WINDOWS")
> '...........................................................................
> ' Evolutions    : 21/04/2008 Updated for VB6  (JPA)
> '---------------------------------------------------------------------------
> Dim cFunctions                                         As New clsFunctions
> Dim lngReturn                                          As Long
> Dim strBufferData                                      As String
> Dim tBI                                                As BROWSEINFO
> 
>     m_strCurrentDirectory = StartDirectory & vbNullChar
>     With tBI
>         .hwndOwner = 0
>         .strWinTitle = lstrcat(WindowTitle, " ")
>         .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN + 
> BIF_STATUSTEXT
>         .lpfnCallback = GetAddressOfFunction(AddressOf BrowseCallbackProc)   
>  'get address of function.
>     End With
> 
>     lngReturn = SHBrowseForFolder(tBI)
>     If (lngReturn) Then
>         strBufferData = Space(MAX_PATH)
>         SHGetPathFromIDList lngReturn, strBufferData
>         strBufferData = Left$(strBufferData, InStr(strBufferData, 
> vbNullChar) - 1)
>         SelectAnyFolder = cFunctions.AddDirSeparator(strBufferData)
>     Else
>         SelectAnyFolder = vbNullString
>     End If
>     Set cFunctions = Nothing
> End Function
> 
> 
> Private Function GetAddressOfFunction(Ptr As Long) As Long
> '---------------------------------------------------------------------------
> ' Procedure     : GetAddressOfFunction
> ' DateTime      : 14/09/2007 14:52
> ' Author        : jp.ambrosino (argyronet)
> ' Purpose       : Retourne un pointeur de fonction
> '...........................................................................
> ' Parameters    : Aucun
> ' Return Codes  : Long = Pointeur de la fonction
> '---------------------------------------------------------------------------
>     GetAddressOfFunction = Ptr
> End Function
> 
> 
> Private Function BrowseCallbackProc(ByVal Hwnd As Long, ByVal uMsg As Long, 
> ByVal lp As Long, ByVal pData As Long) As Long
> '---------------------------------------------------------------------------
> ' Procedure     : BrowseCallbackProc
> ' DateTime      : 14/09/2007
> ' Author        : jp.ambrosino (argyronet)
> ' Purpose       : Function de callback
> '...........................................................................
> ' Parameters    : Aucun
> ' Return Codes  : Long = Callback du process
> '---------------------------------------------------------------------------
> 
> Dim lngRet                                        As Long
> Dim strBufferData                                 As String
> 
>     ' Prevent an error from propagating back into the calling process.
>     On Error Resume Next
>     Select Case uMsg
> 
>         Case BFFM_INITIALIZED
>             Call SendMessage(Hwnd, BFFM_SETSELECTION, 1, 
> m_strCurrentDirectory)
> 
>         Case BFFM_SELCHANGED
>             strBufferData = Space(MAX_PATH)
> 
>             lngRet = SHGetPathFromIDList(lp, strBufferData)
>             If lngRet = eApplicative Then
>                 Call SendMessage(Hwnd, BFFM_SETSTATUSTEXT, 0, strBufferData)
>             End If
> 
>     End Select
>     If Err <> 0 Then Err.Clear
>     BrowseCallbackProc = 0
> End Function
> 
> Sub TestToSee()
>     MsgBox SelectAnyFolder("Your folder...", CurrentProject.Path)
> End Sub
> 
> 'End *************************
> 
> Regards,
> 
> -- 
> Argy
> Goto : http://argyronet.developpez.com/
> Livres :
> Créez des programmes avec Microsoft Access 2007 (ISBN 2742982442)
> VBA pour Office 2007 (ISBN 2742983910) 
> 
> 
> 
> "Rob Hamlin" wrote:
> 
> > I have the API working from (http://www.mvps.org/access/api/api0002.htm). Can 
> > I make the Browse for folder dialog start at a particular folder or unc path 
> > such as \\prt02\projects\?
> > 
> > TIA
0
Utf
4/21/2010 8:25:01 PM
On 21/04/2010 18:58, Rob Hamlin wrote:
> I have the API working from (http://www.mvps.org/access/api/api0002.htm). Can
> I make the Browse for folder dialog start at a particular folder or unc path
> such as \\prt02\projects\?

Save your time!!!

If working in Office 2002 (XP) or newer, there is the FileDialog object. 
It includes an 'InitialFileName' property which also can be pointed at a 
folder.

INFO: The Microsoft Office XP FileDialog Object
http://support.microsoft.com/kb/288543

-- 
Adrian C
0
Adrian
4/21/2010 9:06:19 PM
Ooops sorry, that was my own classes functions. I just copied it here without 
looking with details because it was running well in the projet I'm working on.

Here the corrected code :
'Begin ************************
Option Explicit
Option Private Module

Private Const BIF_STATUSTEXT                           As Long = &H4&
Private Const BIF_RETURNONLYFSDIRS                     As Long = 1
Private Const BIF_DONTGOBELOWDOMAIN                    As Long = 2
Private Const MAX_PATH                                 As Long = 260

Private Const WM_USER                                  As Long = &H400
Private Const BFFM_INITIALIZED                         As Long = 1
Private Const BFFM_SELCHANGED                          As Long = 2
Private Const BFFM_SETSTATUSTEXT                       As Long = (WM_USER + 
100)
Private Const BFFM_SETSELECTION                        As Long = (WM_USER + 
102)

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" 
(ByVal Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam 
As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As 
BROWSEINFO) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As 
Long, ByVal lpBuffer As String) As Long
Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal 
lpString1 As String, ByVal lpString2 As String) As Long

Private Type BROWSEINFO
    hwndOwner                                              As Long
    pIDLRoot                                           As Long
    pszDisplayName                                     As Long
    strWinTitle                                        As Long
    ulFlags                                            As Long
    lpfnCallback                                       As Long
    lParam                                             As Long
    iImage                                             As Long
End Type

Private m_strCurrentDirectory                          As String

Public Function SelectAnyFolder(ByVal WindowTitle As String, ByVal 
StartDirectory As String) As String
'---------------------------------------------------------------------------
' Procedure     : BrowseForFolder
' DateTime      : 14/09/2007
' Author        : jp.ambrosino (argyronet)
' Purpose       : Sélectionne un dossier dans l'arboresence de répertoires
'...........................................................................
' Parameters    : StartDirectory = #
'                 WindowTitle = Window title
' Return Codes  : String = Foldername
'...........................................................................
' Usage         : Example
'                 strPath = SelectAnyFolder("Select a folder from 
:","C:\WINDOWS")
'...........................................................................
' Evolutions    : 21/04/2008 Updated for VB6  (JPA)
'---------------------------------------------------------------------------
Dim lngReturn                                          As Long
Dim strBufferData                                      As String
Dim tBI                                                As BROWSEINFO

    m_strCurrentDirectory = StartDirectory & vbNullChar
    With tBI
        .hwndOwner = 0
        .strWinTitle = lstrcat(WindowTitle, " ")
        .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN + 
BIF_STATUSTEXT
        .lpfnCallback = GetAddressOfFunction(AddressOf BrowseCallbackProc)
 'get address of function.
    End With

    lngReturn = SHBrowseForFolder(tBI)
    If (lngReturn) Then
        strBufferData = Space(MAX_PATH)
        SHGetPathFromIDList lngReturn, strBufferData
        strBufferData = Left$(strBufferData, InStr(strBufferData, 
vbNullChar) - 1)
        SelectAnyFolder = strBufferData & "\"
    Else
        SelectAnyFolder = vbNullString
    End If
End Function


Private Function GetAddressOfFunction(Ptr As Long) As Long
'---------------------------------------------------------------------------
' Procedure     : GetAddressOfFunction
' DateTime      : 14/09/2007 14:52
' Author        : jp.ambrosino (argyronet)
' Purpose       : Retourne un pointeur de fonction
'...........................................................................
' Parameters    : Aucun
' Return Codes  : Long = Pointeur de la fonction
'---------------------------------------------------------------------------
    GetAddressOfFunction = Ptr
End Function


Private Function BrowseCallbackProc(ByVal Hwnd As Long, ByVal uMsg As Long, 
ByVal lp As Long, ByVal pData As Long) As Long
'---------------------------------------------------------------------------
' Procedure     : BrowseCallbackProc
' DateTime      : 14/09/2007
' Author        : jp.ambrosino (argyronet)
' Purpose       : Function de callback
'...........................................................................
' Parameters    : Aucun
' Return Codes  : Long = Callback du process
'---------------------------------------------------------------------------

Dim lngRet                                        As Long
Dim strBufferData                                 As String

    ' Prevent an error from propagating back into the calling process.
    On Error Resume Next
    Select Case uMsg

        Case BFFM_INITIALIZED
            Call SendMessage(Hwnd, BFFM_SETSELECTION, 1, 
m_strCurrentDirectory)

        Case BFFM_SELCHANGED
            strBufferData = Space(MAX_PATH)

            lngRet = SHGetPathFromIDList(lp, strBufferData)
            If lngRet = 0 Then
                Call SendMessage(Hwnd, BFFM_SETSTATUSTEXT, 0, strBufferData)
            End If

    End Select
    If Err <> 0 Then Err.Clear
    BrowseCallbackProc = 0
End Function

Sub TestToSee()
    MsgBox SelectAnyFolder("Your folder...", CurrentProject.Path)
End Sub

'End *************************

Regards
-- 
Argy
Goto : http://argyronet.developpez.com/
Livres :
Créez des programmes avec Microsoft Access 2007 (ISBN 2742982442)
VBA pour Office 2007 (ISBN 2742983910) 



"Rob Hamlin" wrote:

> I get an error "User-Defined type not defined" in this line
> 
> Dim cFunctions                                         As New clsFunctions
> 
> Any Ideas
> 
> "Argyronet" wrote:
> 
> > Hi,
> > 
> > Here is the module code I wrote to do what you looking for...
> > 
> > 'Begin ************************
> > Option Explicit
> > Option Private Module
> > 
> > Private Const BIF_STATUSTEXT                           As Long = &H4&
> > Private Const BIF_RETURNONLYFSDIRS                     As Long = 1
> > Private Const BIF_DONTGOBELOWDOMAIN                    As Long = 2
> > Private Const MAX_PATH                                 As Long = 260
> > 
> > Private Const WM_USER                                  As Long = &H400
> > Private Const BFFM_INITIALIZED                         As Long = 1
> > Private Const BFFM_SELCHANGED                          As Long = 2
> > Private Const BFFM_SETSTATUSTEXT                       As Long = (WM_USER + 
> > 100)
> > Private Const BFFM_SETSELECTION                        As Long = (WM_USER + 
> > 102)
> > 
> > Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" 
> > (ByVal Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam 
> > As String) As Long
> > Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As 
> > BROWSEINFO) As Long
> > Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As 
> > Long, ByVal lpBuffer As String) As Long
> > Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal 
> > lpString1 As String, ByVal lpString2 As String) As Long
> > 
> > Private Type BROWSEINFO
> >     hwndOwner                                              As Long
> >     pIDLRoot                                           As Long
> >     pszDisplayName                                     As Long
> >     strWinTitle                                        As Long
> >     ulFlags                                            As Long
> >     lpfnCallback                                       As Long
> >     lParam                                             As Long
> >     iImage                                             As Long
> > End Type
> > 
> > Private m_strCurrentDirectory                          As String
> > 
> > Public Function SelectAnyFolder(ByVal WindowTitle As String, ByVal 
> > StartDirectory As String) As String
> > '---------------------------------------------------------------------------
> > ' Procedure     : BrowseForFolder
> > ' DateTime      : 14/09/2007
> > ' Author        : jp.ambrosino (argyronet)
> > ' Purpose       : Sélectionne un dossier dans l'arboresence de répertoires
> > '...........................................................................
> > ' Parameters    : StartDirectory = #
> > '                 WindowTitle = Window title
> > ' Return Codes  : String = Foldername
> > '...........................................................................
> > ' Usage         : Example
> > '                 strPath = SelectAnyFolder("Select a folder from :", 
> > "C:\WINDOWS")
> > '...........................................................................
> > ' Evolutions    : 21/04/2008 Updated for VB6  (JPA)
> > '---------------------------------------------------------------------------
> > Dim cFunctions                                         As New clsFunctions
> > Dim lngReturn                                          As Long
> > Dim strBufferData                                      As String
> > Dim tBI                                                As BROWSEINFO
> > 
> >     m_strCurrentDirectory = StartDirectory & vbNullChar
> >     With tBI
> >         .hwndOwner = 0
> >         .strWinTitle = lstrcat(WindowTitle, " ")
> >         .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN + 
> > BIF_STATUSTEXT
> >         .lpfnCallback = GetAddressOfFunction(AddressOf BrowseCallbackProc)   
> >  'get address of function.
> >     End With
> > 
> >     lngReturn = SHBrowseForFolder(tBI)
> >     If (lngReturn) Then
> >         strBufferData = Space(MAX_PATH)
> >         SHGetPathFromIDList lngReturn, strBufferData
> >         strBufferData = Left$(strBufferData, InStr(strBufferData, 
> > vbNullChar) - 1)
> >         SelectAnyFolder = cFunctions.AddDirSeparator(strBufferData)
> >     Else
> >         SelectAnyFolder = vbNullString
> >     End If
> >     Set cFunctions = Nothing
> > End Function
> > 
> > 
> > Private Function GetAddressOfFunction(Ptr As Long) As Long
> > '---------------------------------------------------------------------------
> > ' Procedure     : GetAddressOfFunction
> > ' DateTime      : 14/09/2007 14:52
> > ' Author        : jp.ambrosino (argyronet)
> > ' Purpose       : Retourne un pointeur de fonction
> > '...........................................................................
> > ' Parameters    : Aucun
> > ' Return Codes  : Long = Pointeur de la fonction
> > '---------------------------------------------------------------------------
> >     GetAddressOfFunction = Ptr
> > End Function
> > 
> > 
> > Private Function BrowseCallbackProc(ByVal Hwnd As Long, ByVal uMsg As Long, 
> > ByVal lp As Long, ByVal pData As Long) As Long
> > '---------------------------------------------------------------------------
> > ' Procedure     : BrowseCallbackProc
> > ' DateTime      : 14/09/2007
> > ' Author        : jp.ambrosino (argyronet)
> > ' Purpose       : Function de callback
> > '...........................................................................
> > ' Parameters    : Aucun
> > ' Return Codes  : Long = Callback du process
> > '---------------------------------------------------------------------------
> > 
> > Dim lngRet                                        As Long
> > Dim strBufferData                                 As String
> > 
> >     ' Prevent an error from propagating back into the calling process.
> >     On Error Resume Next
> >     Select Case uMsg
> > 
> >         Case BFFM_INITIALIZED
> >             Call SendMessage(Hwnd, BFFM_SETSELECTION, 1, 
> > m_strCurrentDirectory)
> > 
> >         Case BFFM_SELCHANGED
> >             strBufferData = Space(MAX_PATH)
> > 
> >             lngRet = SHGetPathFromIDList(lp, strBufferData)
> >             If lngRet = eApplicative Then
> >                 Call SendMessage(Hwnd, BFFM_SETSTATUSTEXT, 0, strBufferData)
> >             End If
> > 
> >     End Select
> >     If Err <> 0 Then Err.Clear
> >     BrowseCallbackProc = 0
> > End Function
> > 
> > Sub TestToSee()
> >     MsgBox SelectAnyFolder("Your folder...", CurrentProject.Path)
> > End Sub
> > 
> > 'End *************************
> > 
> > Regards,
> > 
> > -- 
> > Argy
> > Goto : http://argyronet.developpez.com/
> > Livres :
> > Créez des programmes avec Microsoft Access 2007 (ISBN 2742982442)
> > VBA pour Office 2007 (ISBN 2742983910) 
> > 
> > 
> > 
> > "Rob Hamlin" wrote:
> > 
> > > I have the API working from (http://www.mvps.org/access/api/api0002.htm). Can 
> > > I make the Browse for folder dialog start at a particular folder or unc path 
> > > such as \\prt02\projects\?
> > > 
> > > TIA
0
Utf
4/22/2010 8:21:01 AM
Reply:

Similar Artilces:

Outlook Folder List Will Not Close
When I close Outlook, the folder list stays on the screen as if it is frozen there. I have to refresh the screen to make it go away. Anyone have any ideas as to why this happens? Also, it only happens for one user profile on the computer. ...

Folder list, inbox and calender
Hi All I have seen this before but I don't know how it was done. Can anyone tell me how I can view my Folder list, inbox mail and Calendar at the same time all in the same window thanks wayne You can't unless you design a custom Outlook today page. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After searching google.groups.com and finding no answer wayne <wmb37@zoom.co.uk> asked: | Hi All | | I have seen this before but I don't know how it was done. | | Can anyone tell me how I can view my Folder list, inbox | mail a...

net folders "accept" #2
Hi. I am trying to share a calendar with 2 other computers. The calendar computer has sent invitations and the two other computers have "accepted". The computer with the calendar is showing that it is awaiting responses. But I look at Outlook Express and see that the two computers have sent back their acceptances. Since it is being received by OLExpress instead of OL 2000 (where the calendar is located), I wonder if that is why the acceptances haven't been yet received. Any suggestions? Thanks. Scott in Austin MN ...

Empty deleted item folder through exchange server
Hi Everyone, The environment is Win NT 4.00 SP6a and Exchange 5.5 SP4. I would like to empty deleted item folder for all my mailboxes. Is there any way that i can do it from exchange server? Deleted item retention is off on the server. Thanks in advance. http://www.microsoft.com/technet/prodtechnol/exchange/55/maintain/mailmg.mspx F wrote: > Hi Everyone, > > The environment is Win NT 4.00 SP6a and Exchange 5.5 SP4. > I would like to empty deleted item folder for all my > mailboxes. Is there any way that i can do it from exchange > server? > > Deleted item...

Renamed my Sent Folder
Hi all, Somehow I have managed to rename my Sent Folder to -1. Anyone know how I can revert? TIA Bob Start-> Run and type the following "C:\Program Files\Microsoft Office\Office10\Outlook.exe" /resetfoldernames Please replace the the first part with your location of the Outlook.exe file Hope this helps! -- Roady www.sparnaaij.net ----- "Bob Phillips" <bob.phillips@tiscali.co.uk> wrote in message news:O6pjkuxcDHA.2640@TK2MSFTNGP09.phx.gbl... > Hi all, > > Somehow I have managed to rename my Sent Folder to -1. Anyone know how I can > revert? &g...

Outlook 2002 folder permissions
SBS2000, Outlook 2002 on Win2k Setting up delegate to have access to inbox of another user and also want delegate to have access to folder "clients" and all of its subfolders. The user has a folder called "clients" that contains subfolders named for each of his clients that he keeps all received and sent email in. Is there an easier way to give the delegate access to the subfolders under the client folder besides setting the permission on each and every individual subfolder (100+)??? Thanks... ...

Adding Calendar to Favorites Folders
In Outlook 2003 when the Mail navigation pane is selected, how can I ad Calendar and Contacts to the Favorites Folders? Thanks ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com ...

How do I move personal folders out of alphabetical order?
oHi all, I have just started to use Outlokk for my email as opposed to Outlook Express. I have imported everythting I need from OE but the folders in Outlook under 'my personal folders' are in alphabetical order, i.e. inbox,deleted messages, sent items are all mixed in with the statdard folders I have created/Imported. Is there anyway I can move the folders listed above to the top of the list and leave the rest in alphabetical order? Not without renaming the created folders. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to...

restoring deleted Public Folder Calendar events
Is there a way to restore a deleted event from a Public Folder Calendar? Not easily. You can restore the entire database to a recovery server and then use Outlook to move the appointment to a PST and then to the production folder. You might look into OnTrack Power Controls or Quest Recovery Manager, products that might do what you want a whole lot more easily. -- Ed Crowley MVP "There are seldom good technological solutions to behavioral problems." .. "Pearl" <Pearl@discussions.microsoft.com> wrote in message news:2A523A7D-E9F5-4A1D-A414-4803F65DB8...

Can't create a New Folder in Outlook
Hello: On one workstation here on our network (which has Outlook 2000), one workstation cannot create a new folder in her Inbox. When she tries, she gets the error message "Outlook can't read the registry info". What can I do to eliminate this issue? The funny thing is that I did a search on her C drive in Windows Explorer and did not even see a .pst file to backup! Now, if I run the repair option from the Office CD, would that wipe out her e-mails and stuff? I don't want to do that. Thanks, in advance, for any help that you can give. John If the workstation i...

Why is favorites folder missing in file, open in office 2003?
I just moved to Office 2003 in a corporate environment. When I go to open a file in Office (Excel), the Favorites icon no longer appears on the left hand side. I really use that feature. Can I get it back? I can't find anyway to do it? If I can't do it, what are some alternatives for acheiving the same function? Janis File>Open. In the Look in: browse to your C:\Documents and Settings\user\ and select Favorites folder. Don't open it, just select it. Now go over and click on Tools and "Add to My Places" This can be done with any folder you wish to have on...

CFileDialog dialog doesn't release program folder untill the app exits.
Hi, everyone: My tester found a bug of my responsible software. However, notepad also behaves in the same way. Launch notepad, input something, save to a folder. Turn to Windows Explorer to delete that folder. Windows shows an error message box, saying " Cannot delete <folder name>; It is being used by another person or program. ....". Close Notepad, try to delete it again. Successful. I am astonishing about this!!!! Any idea? Thanks Eric On Wed, 28 Mar 2007 16:48:49 +0800, "Eric" <EricLiu@moxrd.com> wrote: >Hi, everyone: > >My tester found...

New Folders Appeared in Outlook 2007
Opened Outlook 2007 in XP and found new folders -bash_history -bash_logout -bash_profile -bbashrc -mailboxlist -zshrc What are these and do I need them? How do I get rid of them? Longshot wrote: > Opened Outlook 2007 in XP and found new folders > -bash_history > -bash_logout > -bash_profile > -bbashrc > -mailboxlist > -zshrc > > What are these and do I need them? How do I get rid of them? This is with an IMAP account? Those folders shouldn't be in Outlook otherwise. (They shouldn't be their with imap either - they are linux folde...

PUBLIC FOLDER #3
HOW CAN I TELL WHICH SERVERS HAS A REPLICA OF CERTAIN PUBLIC FOLDER. Currently i have to go to each server and check the instances of that folder , is there a easier way that tells me, which servers has a replica of each public folder. In System Manager, expand the "folder" hierarchy and go to public folders and expand it. Right click any folder and go to properites and check out the "replicas" tab. This will tell u which servers have the replica of the folder. -- Mike Manjunath Microsoft Corp. "Please do not send email directly to this alias. This alias is for ...

How do I change default Personal Folders File?
I originally set up Outlook to operate on my XP system. I recently installed Vista on a seperate Hard Disk and for the time being had it point to the XP pst file (on disk G as far as Vista is concerned). That way I could use Outlook regardless of which system I logged into. When I use Vista, I have 2 sets of Personal Folders - the first (and default) is the one on disk G (the Xp drive) the second is the Vista version on disk C. I am now happy enough with Vista to make that my default OS and want to relocate the pst file to the correct location on Disc C. I have copied the "G"...

Inbox folder problems
Hello everyone, My inbox does not show my new messages, but all my deleted messages all of a sudden show up in my inbox! I need to find out how to reroute my inbox messages, and get rid of those deleted messages so that they don't pop up in my inbox. Please help! -- Thank you, Electricbluelady "electricbluelady" <electricbluelady@discussions.microsoft.com> wrote in message news:AAB863D1-D67D-41E3-9B91-DEFF173AC2AE@microsoft.com... > My inbox does not show my new messages, but all my deleted messages all of a > sudden show up in my inbox! I need to f...

Default Contacts Folder
I need to change the default folder Contacts are stored in. Using Outlook 2003 linked to a 2003 Exchange Server, I can change the default folder to a Public Folder and all contacts will automatically save to that folder. Using Outlook 2003 linked to a 2007 Exchange Server, it doesn't work. The settings I can find appear to be the same. Does anyone have any ideas? How exactly did you change the "default" contacts folder to one in the <Public Folder> group? Default folders by definition are located in the default <mailbox> store (whether PST or Excha...

how should the Folder List look in outlook 2003
Hello How should the Folder List look in Outlook 2003 sp1 ? I 've set my oulook to always open in Inbox with Folder List on the left. But I'd like to see the image of the default Folder List. Thank you. Regards hash what do you see that you think is not right? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Search Engines (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com...

Excel 2000 hangs on opening a large folder, every other time.
Client has a large folder with a lot of spreadsheets and subfolders: 3685 sheets in 172 subfolders. The top level folder and subfloders reside on a windows 2003 server. If, he opens excel 2000, and then does a file/open in the top level folder the first time, Excel hangs. The end result is a "not responding" from task manager. If he blows excel away and then restarts excel and does the fame file/open, the folder/file list inside the top level folder is presented immediately. Windows explorer has no problem opening the top level folder and displaying the subfolders undern...

Missing Deleted Items Folder
I have an email account that is set up within Outlook, among others. The others all have a Deleted Items folder. Whenever, I deleted an email, it shoots over to the deleted items folder - of course. Now, for the one email account without a "deleted Items" folder, the deleted items remain in the main email account "shadowed out." There is no deleted items folder to move to. I am unable to delete the items at all. They hang in the inbox. I must have deleted the "deleted Items" folder. How can I put a created "Deleted Items" folder into the ...

Public Folder
Is there a way in MS Exchange to to do the following automaticaly? Right-click the Contacts folder, click Properties on the shortcut menu, and then click the Outlook Address Book tab. Select the Show this folder as an e-mail address book check box. ...

Public Folder Replicas #4
I have been testing PF replication to a remote server. This server has no backups and we have lost one of the hard drives (containing the Public Folder Store database). If I recreate an empty database will I lose any public folders? Is it safe to remove the replica information about the failed server and re-create an empty database? ...

Public folder permissions problems
I migrated from Exchange 2000 to 2003. Now my public folder permissions are a mess!!! The permissions I set from Outlook client don't take. When I try to set the permissions from Ex System Manager, I get "Invalid windows handle". Knowledge base article 313333 does not work as I don't have an option to move public folders from System Manager. Can I reset the folder permissions somehow? You could use PFDavAdmin, but be very careful with this tool. Consider enlisting the help of Microsoft PSS. http://hellomate.typepad.com/exchange/2003/10/the_pfdavadmin_.html -- Neil ...

Outlook and Offline Folders using IMAP
I'm running Outlook 2007. It seams to support the IMAP protocol reasonably well. However, I can't figure out how to move messages between folders when I'm offline (it gives an error message saying I can't, see below). This same operation works fine in MS Windows Mail (the equivalent of Outlook Express that ships with Windows Vista) and Mozilla Thunderbird. It's clearly not a limitation of IMAP. I can download messages and read and delete them when I'm offline. I just can't move them between folders unless I'm online. Since Outlook synchronizes any changes to a ...

Outlook 2003 frequently says no folders avaiable...
After I've had the ap running for a while, in the mail window I'll get a message regarding the unavailability of folders and can't display any messages. All email is gone (from view) etc. If I shutdown/restart, everything returns to normal, for a while. My pst corrupt or too big? Or??? Thanks. Might want to include some information with your post if you are asking for help in a newsgroup. -- Russ Valentine [MVP-Outlook] "Hotkey" <nope@notnow.net> wrote in message news:8zXBj.72873$yE1.52579@attbi_s21... > After I've had the ap running for a whil...