Hi
I am currently writing a program to update an access database when emails that are sent bounce.
I have this code which i have developed to get the To Address from the bounced email which has been forwarded to a nominated folder by our exchange server.
On the code "strSubject = Mailobject.To" i get the error Object Does not support this property or method. If i change it to MailObject.Subject it returns the subject (as it is the default property it also gets the subject from just MailObject). I cannot find the property which will retrieve the TO address.
Thanks Si
Dim OlApp As Outlook.Application
Dim Inbox As Outlook.MAPIFolder
Dim InboxItems As Outlook.Items
Dim Mailobject As Object
Set OlApp = CreateObject("Outlook.Application"
Set Inbox = OlApp.GetNamespace("Mapi".GetFolderFromID("000000001A447390AA6611CD9BC800AA002FC45A0300FF6C9755E895FE4D94EA24DA77841BA4000000001CAF0000"
Set InboxItems = Inbox.Items
Dim strSubject As String
For Each Mailobject In InboxItems
'on error resume next
strSubject = Mailobject.To
MsgBox strSubject
Next
Set OlApp = Nothing
Set Inbox = Nothing
Set InboxItems = Nothing
Set Mailobject = Nothing
I am currently writing a program to update an access database when emails that are sent bounce.
I have this code which i have developed to get the To Address from the bounced email which has been forwarded to a nominated folder by our exchange server.
On the code "strSubject = Mailobject.To" i get the error Object Does not support this property or method. If i change it to MailObject.Subject it returns the subject (as it is the default property it also gets the subject from just MailObject). I cannot find the property which will retrieve the TO address.
Thanks Si
Dim OlApp As Outlook.Application
Dim Inbox As Outlook.MAPIFolder
Dim InboxItems As Outlook.Items
Dim Mailobject As Object
Set OlApp = CreateObject("Outlook.Application"
Set Inbox = OlApp.GetNamespace("Mapi".GetFolderFromID("000000001A447390AA6611CD9BC800AA002FC45A0300FF6C9755E895FE4D94EA24DA77841BA4000000001CAF0000"
Set InboxItems = Inbox.Items
Dim strSubject As String
For Each Mailobject In InboxItems
'on error resume next
strSubject = Mailobject.To
MsgBox strSubject
Next
Set OlApp = Nothing
Set Inbox = Nothing
Set InboxItems = Nothing
Set Mailobject = Nothing