Select Directory Catalog

Directory Catalog Dialog Box Explorer Stile
(Option Declaration) 
Type TagBrowseInfo 
        hwndOwner As Long 
        pidlRoot As Long 
        pszDisplayName As String 
        lpszTitle As String 
        ulFlags As Long 
        lpFn As Long 
        iImage As Long 
End Type 
Declare Function SHGetMalloc Lib "Shell32.dll" Alias "SHGetMalloc" _ 
(Malloc As Variant) As Long 
Declare Function SHGetSpecialFolderLocation Lib "Shell32.dll" Alias "SHGetSpecialFolderLocation" _ 
(Byval hwnd As Long, Byval nFolder As Long, PIDL As Long)  As Long 
Declare Function SHBrowseForFolder Lib "Shell32.dll" Alias "SHBrowseForFolder" _ 
(BROWSEINFO As TagBrowseInfo)  As Long 
Declare Function SHGetPathFromIDList  Lib "Shell32.dll" Alias "SHGetPathFromIDList" _ 
(Byval PIDL As Long, Byval pszPath As String)  As Long 
Sub Click(Source As Button) 
        Dim BROWSEINFO As TagBrowseInfo 
        Dim DisplayName As String * 260 
        Dim Title As String 
        Dim SPIDL As Long 
        Dim PIDL As Long 
        Dim MAlloc As Variant 
        Dim Workspace As New NotesUIWorkspace 
        Dim Doc As NotesDocument 
        Set Doc = Workspace.CurrentDocument.Document 
        R = CoInitialize(0&) 
        If SHGetMalloc(MAlloc) <> 0 Then Exit Sub 
        If SHGetSpecialFolderLocation(0&, 17&, SPIDL) = 0 Then 
                Title = "������� ����� ��� ���������� ������!" 
                BROWSEINFO.pidlRoot = SPIDL 
                BROWSEINFO.ulFlags = 64& 
                BROWSEINFO.hwndOwner = 0& 
                BROWSEINFO.pszDisplayName = DisplayName 
                BROWSEINFO.lpszTitle = Title 
                PIDL =  SHBrowseForFolder(BROWSEINFO) 
                If PIDL <> 0  Then 
                        On Error        Resume Next 
                        If  SHGetPathFromIDList(PIDL, DisplayName) <> 0 Then 
                                Doc.DirectoryName = DisplayName 
                        End If 
                End If 
        End If 
        Set Malloc = Nothing 
End Sub

This was first published in January 2001

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.