Hello everyone!
I'm having trouble with something that I cannot resolve. It has to do with outlook.application
What I would like to do is combine the contents of two different in boxes (AInbox and BInbox) such that a 'For Each' statement can process the contents of both as one box.
Set AInbox = OlApp.GetNamespace("MAPI").Folders("Personal Folders"). ...etc to A box name
Set BInbox = OlApp.GetNamespace("MAPI").Folders("Personal Folders"). ...etc to B different box name
Set AInboxItems = AInbox.items.Restrict("[Unread] = true")
Set BInboxItems = BInbox.items.Restrict("[Unread] = true")
' I have been processing mailitems with a single For Each ... loop which is working fine
For Each MailObject In AInboxItems
However, now I need to do something such as:
CombinedInboxItems = AInboxItems + BInboxItems '(This is probably bad syntax but it illustrates my intent)
'Then within a single For Each loop
For Each MailObject In CombinedInboxItems
Any ideas would be very much appreciated.
Lamar
I'm having trouble with something that I cannot resolve. It has to do with outlook.application
What I would like to do is combine the contents of two different in boxes (AInbox and BInbox) such that a 'For Each' statement can process the contents of both as one box.
Set AInbox = OlApp.GetNamespace("MAPI").Folders("Personal Folders"). ...etc to A box name
Set BInbox = OlApp.GetNamespace("MAPI").Folders("Personal Folders"). ...etc to B different box name
Set AInboxItems = AInbox.items.Restrict("[Unread] = true")
Set BInboxItems = BInbox.items.Restrict("[Unread] = true")
' I have been processing mailitems with a single For Each ... loop which is working fine
For Each MailObject In AInboxItems
However, now I need to do something such as:
CombinedInboxItems = AInboxItems + BInboxItems '(This is probably bad syntax but it illustrates my intent)
'Then within a single For Each loop
For Each MailObject In CombinedInboxItems
Any ideas would be very much appreciated.
Lamar