Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browse Folders through Windows Shortcuts Outlook Macro

Status
Not open for further replies.
Jun 8, 2011
30
CA
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top