J
jayadev
Can anyone tell me to access the homephonenumber of the
personal address book recipient using CDO,
Dim objSession As MAPI.Session
Set objSession = CreateObject("MAPI.Session")
objSession.Logon "", "", False, False, 0
Dim objMessage As MAPI.Message
Dim oAddressEntries As AddressEntries
Dim oAddressList As AddressList
Dim oRecipients As Recipients
Dim oRecipient As Recipient
Dim oAddressEntry As AddressEntry
Dim oMember As AddressEntry
Dim MyFields As MAPI.Fields
Dim myField As MAPI.Field
Set objMessage = objSession.Outbox.Messages.Add
Set oRecipient = objMessage.Recipients.Add
oRecipient.Name = "(e-mail address removed)"
oRecipient.Resolve
Set oAddressEntry = oRecipient.AddressEntry
Set MyFields = oAddressEntry.Fields
For Each myField In MyFields
MsgBox myField.Value
Next
Set Mydept = MyFields
(CdoPR_OFFICE_TELEPHONE_NUMBER).Value
It is genearating an error even though a number exists
Can anyone please help me out.
personal address book recipient using CDO,
Dim objSession As MAPI.Session
Set objSession = CreateObject("MAPI.Session")
objSession.Logon "", "", False, False, 0
Dim objMessage As MAPI.Message
Dim oAddressEntries As AddressEntries
Dim oAddressList As AddressList
Dim oRecipients As Recipients
Dim oRecipient As Recipient
Dim oAddressEntry As AddressEntry
Dim oMember As AddressEntry
Dim MyFields As MAPI.Fields
Dim myField As MAPI.Field
Set objMessage = objSession.Outbox.Messages.Add
Set oRecipient = objMessage.Recipients.Add
oRecipient.Name = "(e-mail address removed)"
oRecipient.Resolve
Set oAddressEntry = oRecipient.AddressEntry
Set MyFields = oAddressEntry.Fields
For Each myField In MyFields
MsgBox myField.Value
Next
Set Mydept = MyFields
(CdoPR_OFFICE_TELEPHONE_NUMBER).Value
It is genearating an error even though a number exists
Can anyone please help me out.