B
BigPig
Hi All,
I'm trying to get an Outlook display name from an outlook address book and
put it in a text box. I can open the address book, but can't seem to find a
way to get the display name. Any and all help would be greatly appreciated.
See the script below. Thanks -BigPig-
Set appOutlook = CreateObject("Outlook.Application")
Set CDOSession = appOutlook.CreateObject("MAPI.Session")
CDOSession.Logon "", "", False, False, 0
On Error GoTo ErrHand
Set Recipients = CDOSession.addressbook(Nothing, "Address Book", False,
True, 1, "To:", "", "", 0)
Dim OLDN As String
OLDN = Recipients
Stop
txt_SUYI_OutL_Display_Name = OLDN
Set appOutlook = Nothing
Set CDOSession = Nothing
ErrHand:
Set appOutlook = Nothing
Set CDOSession = Nothing
Exit Sub
txt_SUYI_OutL_Display_Name = OLDN
Set appOutlook = Nothing
Set CDOSession = Nothing
I'm trying to get an Outlook display name from an outlook address book and
put it in a text box. I can open the address book, but can't seem to find a
way to get the display name. Any and all help would be greatly appreciated.
See the script below. Thanks -BigPig-
Set appOutlook = CreateObject("Outlook.Application")
Set CDOSession = appOutlook.CreateObject("MAPI.Session")
CDOSession.Logon "", "", False, False, 0
On Error GoTo ErrHand
Set Recipients = CDOSession.addressbook(Nothing, "Address Book", False,
True, 1, "To:", "", "", 0)
Dim OLDN As String
OLDN = Recipients
Stop
txt_SUYI_OutL_Display_Name = OLDN
Set appOutlook = Nothing
Set CDOSession = Nothing
ErrHand:
Set appOutlook = Nothing
Set CDOSession = Nothing
Exit Sub
txt_SUYI_OutL_Display_Name = OLDN
Set appOutlook = Nothing
Set CDOSession = Nothing