Jim H.
New Member
- Outlook version
- Outlook 2010 32 bit
- Email Account
- IMAP
I have an Access database designed to track Work Orders for maintenance to properties. When an owner emails a request for maintenance, a work order is started. What the users of the database would like to do is track the email conversation associated with the Work Order.
In Access, I've linked to the InBox of the maintenance account in Outlook. In Microsoft's great wisdom, I'm not given access to the EntryID or ConversationID of a message, but with some hocus-pocus, I've managed to get the ConversationID. But I can't get Outlook to open a separate session that shows only the messages associated with that ID.
Here's the code I'm using:
strEmailAccount = DLookup("EmailAccount", "tblAdmin")
'Open Outlook session with emails restricted to the ConversationID
Set objOL = CreateObject("Outlook.Application") 'Create a new instance
strFilter = "[ConversationID] = '" & strConversationID & "'"
For Each objAccount In objOL.Session.Accounts
If objAccount = strEmailAccount Then
Set objStore = objAccount.DeliveryStore
Set objInbox = objStore.GetDefaultFolder(olFolderInbox)
Set objEmails = objInbox.Items.Restrict(strFilter)
objInbox.Display
End If
Next
What am I doing wrong, or is it even possible to use the Restrict method with ConversationID (can't find any documentation that says I can't).
Many thanks.
In Access, I've linked to the InBox of the maintenance account in Outlook. In Microsoft's great wisdom, I'm not given access to the EntryID or ConversationID of a message, but with some hocus-pocus, I've managed to get the ConversationID. But I can't get Outlook to open a separate session that shows only the messages associated with that ID.
Here's the code I'm using:
strEmailAccount = DLookup("EmailAccount", "tblAdmin")
'Open Outlook session with emails restricted to the ConversationID
Set objOL = CreateObject("Outlook.Application") 'Create a new instance
strFilter = "[ConversationID] = '" & strConversationID & "'"
For Each objAccount In objOL.Session.Accounts
If objAccount = strEmailAccount Then
Set objStore = objAccount.DeliveryStore
Set objInbox = objStore.GetDefaultFolder(olFolderInbox)
Set objEmails = objInbox.Items.Restrict(strFilter)
objInbox.Display
End If
Next
What am I doing wrong, or is it even possible to use the Restrict method with ConversationID (can't find any documentation that says I can't).
Many thanks.