accessDatabase
Member
- Outlook version
- Outlook 2016 64 bit
- Email Account
- IMAP
Hi all,
Is there a field within an Outlook mailItem which allows you to store an ID number e.g. 123456 which you can read from their reply email?
I am trying to insert a contactId somewhere in the email which I can read when the person replies and use to make updates to an Access database. I would rather not have to show the contactId in the body of the email. I tried using the 'mileage' field but it came back empty in the reply.
I have tried to capture conversationID from the last sent message in the sent folder and then pair it with the conversationID of the reply email but they don't match up.
The code I used to get the conversationID of the last sent message in the sent folder is:
The code I used to get the conversationID from the reply email is:
Thanks!
Is there a field within an Outlook mailItem which allows you to store an ID number e.g. 123456 which you can read from their reply email?
I am trying to insert a contactId somewhere in the email which I can read when the person replies and use to make updates to an Access database. I would rather not have to show the contactId in the body of the email. I tried using the 'mileage' field but it came back empty in the reply.
I have tried to capture conversationID from the last sent message in the sent folder and then pair it with the conversationID of the reply email but they don't match up.
The code I used to get the conversationID of the last sent message in the sent folder is:
Dim ns As NameSpace
Dim f As Folder
Dim items As items
Dim mailSent As MailItem
Set ns = Application.Session
Set f = ns.GetDefaultFolder(olFolderSentMail)
Set items = f.items
items.Sort "SentOn", False
Set mailSent = items.Item(items.Count)
Debug.Print mailSent.Subject
Debug.Print "last mail sent: " & mailSent.ConversationID
The code I used to get the conversationID from the reply email is:
Dim oApp As Outlook.Application
Set oApp = GetObject(, "Outlook.Application")
Dim oMail As Outlook.MailItem
Set oMail = oApp.ActiveExplorer.Selection.Item(1)
Debug.Print oMail.ConversationID
Thanks!