And another way to set the folder. The example I've extracted from an OL97
application below runs from outside Outlook and should set olFldr to a pre
existing folder called "Email Contacts" set to contain Contact items and
then creates a single contact item in it.
This won't help you directly but I assume you can use the move method of the
mailitem object in the Inbox to move the email to destination folder olFldr.
Have not done it myself tho
Dim olOutlookApp As Outlook.Application
Dim olNms As Outlook.NameSpace
Dim olFldrP As Outlook.MAPIFolder 'parent public folder
Dim olFldr As Outlook.MAPIFolder 'actual contacts public folder
Dim olItms As Outlook.Items 'folder items list
Dim olItm As Outlook.ContactItem 'folder item
'check if Outlook is running
On Error Resume Next
Set olOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set olOutlookApp = CreateObject("Outlook.Application")
End If
'set Outlook namespace
Set olNms = olOutlookApp.GetNamespace("MAPI")
'set reference to the public folder named Email Contacts
Set olFldrP = olNms.Folders("Public Folders")
Set olFldrP = olFldrP.Folders("All Public Folders")
Set olFldr = olFldrP.Folders("Email Contacts")
Set olItms = olFldr.Items
'Create a single contact item
Set olItm = olItms.Add("IPM.Contact")
With olItm
.Title = "Mr"
.FirstName = "John"
.LastName = "Doe"
.CompanyName = "ABC Co Ltd"
.Close (olSave)
End With