N
n777krish
Hello all,
I am trying to get the Recipient (Distribution List) from an
ActiveInspector. The code that I am using is below. I am trying to
retrieve the recipient from MS Word VBA. If I put the same code in
Outlook VBA I am able to access the Members of the distribution list.
Now what gets interesting is when I put the code in Word VBA and get a
reference to ActiveInspector.CurrentItem into a SafeMailItem, for some
reason the Recipient's -> AddressEntry -> Members no longer seem to
be available.
I need to access the distribution list from the recipient of the
ActiveInspector from Word. What am I doing wrong? Is redemption loosing
the recipient properties for some reason?
Even for a normal recipient I am not able to access the PR_DISPLAY_NAME
and PR_SURNAME fields for the address entries when I try to access
these from Word VBA.
I am not able to access the AddressEntry.members.count or any other
properties of AddressEntry.
I would appreciate the help.
Thanks,
neil goundar
********************************************************************************************************
Public Sub GetRecipientName()
Dim oMail As Outlook.MailItem
Dim sfeMail 'As Redemption.SafeMailItem
Dim intType As Integer
Dim golapp As Outlook.Application
Dim rec
Dim aEntry, myAddressEntry
Set golapp = CreateObject("Outlook.Application", "localhost")
Set oMail = golapp.ActiveInspector.CurrentItem
Set sfeMail = CreateObject("sndRedemption.sndSafeMailItem")
Set sfeMail.Item = oMail
sfeMail.Save
Set rec = sfeMail.Recipients(1)
Debug.Print rec.Name
Debug.Print rec.DisplayType
Set aEntry = rec.AddressEntry
For i = 1 To aEntry.Members.Count
Set myAddressEntry = aEntry.Members()
Debug.Print myAddressEntry.Name
Next i
End Sub
I am trying to get the Recipient (Distribution List) from an
ActiveInspector. The code that I am using is below. I am trying to
retrieve the recipient from MS Word VBA. If I put the same code in
Outlook VBA I am able to access the Members of the distribution list.
Now what gets interesting is when I put the code in Word VBA and get a
reference to ActiveInspector.CurrentItem into a SafeMailItem, for some
reason the Recipient's -> AddressEntry -> Members no longer seem to
be available.
I need to access the distribution list from the recipient of the
ActiveInspector from Word. What am I doing wrong? Is redemption loosing
the recipient properties for some reason?
Even for a normal recipient I am not able to access the PR_DISPLAY_NAME
and PR_SURNAME fields for the address entries when I try to access
these from Word VBA.
I am not able to access the AddressEntry.members.count or any other
properties of AddressEntry.
I would appreciate the help.
Thanks,
neil goundar
********************************************************************************************************
Public Sub GetRecipientName()
Dim oMail As Outlook.MailItem
Dim sfeMail 'As Redemption.SafeMailItem
Dim intType As Integer
Dim golapp As Outlook.Application
Dim rec
Dim aEntry, myAddressEntry
Set golapp = CreateObject("Outlook.Application", "localhost")
Set oMail = golapp.ActiveInspector.CurrentItem
Set sfeMail = CreateObject("sndRedemption.sndSafeMailItem")
Set sfeMail.Item = oMail
sfeMail.Save
Set rec = sfeMail.Recipients(1)
Debug.Print rec.Name
Debug.Print rec.DisplayType
Set aEntry = rec.AddressEntry
For i = 1 To aEntry.Members.Count
Set myAddressEntry = aEntry.Members()
Debug.Print myAddressEntry.Name
Next i
End Sub