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
Else
Beep
End If
Malloc.Free(PIDL)
End If
Malloc.Free(SPIDL)
End If
Set Malloc = Nothing
End Sub
Start the conversation
0 comments