G
Guest
Sue..........I have one of your books and found the following code:
Function GetMailBoxUserName()
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objInbox As Outlook.MAPIFolder
Dim strName As String
Dim intPos As Integer
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
strName = objInbox.Parent.Name
intPos = InStr(1, strName, "Mailbox - ", vbTextCompare)
If intPos > 0 Then
GetMailBoxUserName = Right(strName, intPos + 9)
End If
Set objInbox = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Function
This gets me close to what I'm trying to do but not exactly. In our system,
the address list for e-mails contains the employee's job title. What I would
like to do is get the employee's job title instead of their mailbox name.
Is it possible to modify the above code to get the employee's job title
instead of the mailbox name? Or can I use the mailbox name to find the job
title. I apologize for all of the questions but I'm new to programming in
Outlook and have seen that you have helped a lot of people. The book and
your web site have been terrific resources. Thanks for all of the help.
Function GetMailBoxUserName()
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objInbox As Outlook.MAPIFolder
Dim strName As String
Dim intPos As Integer
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
strName = objInbox.Parent.Name
intPos = InStr(1, strName, "Mailbox - ", vbTextCompare)
If intPos > 0 Then
GetMailBoxUserName = Right(strName, intPos + 9)
End If
Set objInbox = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Function
This gets me close to what I'm trying to do but not exactly. In our system,
the address list for e-mails contains the employee's job title. What I would
like to do is get the employee's job title instead of their mailbox name.
Is it possible to modify the above code to get the employee's job title
instead of the mailbox name? Or can I use the mailbox name to find the job
title. I apologize for all of the questions but I'm new to programming in
Outlook and have seen that you have helped a lot of people. The book and
your web site have been terrific resources. Thanks for all of the help.