WeiszMCITP
MIS
Hello,
I've created an Outlook Macro that allows a user to selecte an email message, click a button to run my macro, and then select a location to save the email message as a .msg
The problem is that I am using the BrowseForFolder command and it does not allow a user to double click a shortcut on their desktop to take them to its target location. The &H4000 switch will allow the user to see the shortcut, but it is not double clickable.
Is there a way to allow users to use Windows shortcuts in the BrowseForFolder dialog box to get to a folder location or do I have to use another command?
------
Code
-----
Function GetFolderName(strStartingFolder As Variant) As String
Const WINDOW_HANDLE = 0
Const ALL_OPTIONS = &H4000
Dim objShell As Object, _
objFolder As Object, _
objFolderItem As Object
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(WINDOW_HANDLE, "Select a folder:", ALL_OPTIONS, strStartingFolder)
If Not TypeName(objFolder) = "Nothing" Then
Set objFolderItem = objFolder.self
GetFolderName = objFolderItem.Path & "\"
Else
GetFolderName = ""
End If
Set objFolderItem = Nothing
Set objFolder = Nothing
Set objShell = Nothing
End Function
------
Code
------
Thank you!
I've created an Outlook Macro that allows a user to selecte an email message, click a button to run my macro, and then select a location to save the email message as a .msg
The problem is that I am using the BrowseForFolder command and it does not allow a user to double click a shortcut on their desktop to take them to its target location. The &H4000 switch will allow the user to see the shortcut, but it is not double clickable.
Is there a way to allow users to use Windows shortcuts in the BrowseForFolder dialog box to get to a folder location or do I have to use another command?
------
Code
-----
Function GetFolderName(strStartingFolder As Variant) As String
Const WINDOW_HANDLE = 0
Const ALL_OPTIONS = &H4000
Dim objShell As Object, _
objFolder As Object, _
objFolderItem As Object
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(WINDOW_HANDLE, "Select a folder:", ALL_OPTIONS, strStartingFolder)
If Not TypeName(objFolder) = "Nothing" Then
Set objFolderItem = objFolder.self
GetFolderName = objFolderItem.Path & "\"
Else
GetFolderName = ""
End If
Set objFolderItem = Nothing
Set objFolder = Nothing
Set objShell = Nothing
End Function
------
Code
------
Thank you!