deafmetal1
Senior Chief
- Local time
- Today, 13:08
- Joined
- May 2, 2008
- Messages
- 30
Hello,
In my quest to build a email message parsing tool, I can manually VBA code the folder location I wish to parse. But I'd rather provide a button on the form to which would result in a folder menu for the user to select where the parsing is to occur. This prevents a novice user from having to enter VBA to manually edit the folder location, and quite possibly screw it up.
I can get the folder selection menu to work, but I cannot figure out how to store the location they select. I built a table that I tried to store the selected location in... no joy. I'd also like my VBA to pull the folder location from that table.
Here's the folder list code I have so far that I cannot figure out how to store and retrieve:
Here's the hard coded folder location that I have been using in lieu of a user friendly selection box:
Appreciate your assistance!!
In my quest to build a email message parsing tool, I can manually VBA code the folder location I wish to parse. But I'd rather provide a button on the form to which would result in a folder menu for the user to select where the parsing is to occur. This prevents a novice user from having to enter VBA to manually edit the folder location, and quite possibly screw it up.
I can get the folder selection menu to work, but I cannot figure out how to store the location they select. I built a table that I tried to store the selected location in... no joy. I'd also like my VBA to pull the folder location from that table.
Here's the folder list code I have so far that I cannot figure out how to store and retrieve:
Code:
Private Sub FLDR_Click()
Dim rs As DAO.Recordset
Dim strPath As String
strPath = Application.CodeProject.Path
Dim olApp As Outlook.Application
Set olApp = New Outlook.Application
Dim olNS As Outlook.NameSpace
Dim MyFolder As Outlook.MAPIFolder
On Error Resume Next
Set olNS = olApp.GetNamespace("MAPI")
Set MyFolder = olNS.PickFolder
Set rs = rs.OpenRecordset("Folder")
rs.AddNew
rs("Folder").Value = Left(olNS, 255)
Set rs = Nothing
Set olNS = Nothing
Set MyFolder = Nothing
End Sub
Here's the hard coded folder location that I have been using in lieu of a user friendly selection box:
Code:
Dim strPath As String
strPath = Application.CodeProject.Path
Dim olApp As Outlook.Application
Set olApp = New Outlook.Application
Dim olNS As Outlook.NameSpace
Set olNS = olApp.GetNamespace("MAPI")
' this is the location of the messages
' Public Folder Code below:
Dim olFld As Outlook.MAPIFolder
Set olFld = olNS.Folders("Public Folders").Folders("All Public Folders").Folders("Testing")
Appreciate your assistance!!