Question Need to get Mailbox ID from outlook for an Email (1 Viewer)

Manjeeth Kidiyoor

New member
Local time
Today, 15:07
Joined
Aug 18, 2016
Messages
3
Hi Team..

I have multiple mailbox access in my Outlook.

The mail which i open and run the macro should give me the Mailbox ID.

The below codes gives me all the Mailbox IDs but i need only one MailID where the mail has been received.

Could someone please help me with this. Thank you so much in advance.



Sub Test()
Dim objSession
Dim objNamespace
Dim objMailbox

Set objSession = Application.Session
Set objNamespace = Application.GetNamespace("MAPI")
For Each objMailbox In objSession.Folders
MsgBox objMailbox.Name

Next
End Sub
 
Local time
Today, 02:37
Joined
Oct 15, 2016
Messages
1
Hi Team..





Sub Test()
Dim objSession
Dim objNamespace
Dim objMailbox

Set objSession = Application.Session
Set objNamespace = Application.GetNamespace("MAPI")
For Each objMailbox In objSession.Folders
MsgBox objMailbox.Name

Next
End Sub
Any help? I'm smashing my head to a wall. :banghead:
 

Users who are viewing this thread

Top Bottom