J
Jeff Rush
Hi All,
I hate to post the same question to two NG's but after posting the first one
it seems more appropriate to this NG.
I have been struggeling with this beast for some time now and have yet to
get this to work the way I would like..
I can get the recipients list and walk through it. The code below works.
However if I do MyRecipient.Members(x) I am unable to get a reliable count
or properly pull the name and address list values from them.
I have tried code similar to the following:
For i = 1 To myolsel.Count
Set myrecip = myolsel(i)
If myrecip.Recipients.AddressEntries.Members.Count > 1 Then
For Each entry In myrecip.Recipients.AddressEntry.Members
mystr = mystr & Chr$(13) + myrecip.AdressEntry.Members.Name
mystr = mystr & "; " & myrecip.AdressEntry.Members.Address
Next
End If
Next
This did not work either.
Any help would be greatly appreciated!!
Jeff
Here is my code as it stands.
===================================================
===================================================
Private Sub DLBreakout()
Dim MyBodStr As String
'Set Variable to select the default INBOX folder
Set myFolder = Session.GetDefaultFolder(olFolderInbox)
'Set variable to the (collection of) selected items in Inbox.
Set myolsel = Application.ActiveExplorer.Selection
'Set Source and Target forms
Set myolsel = Application.ActiveExplorer.Selection
Set targetitem = myFolder.Items.Add("ipm.note.dllist")
Set sourceitem = myolsel(1)
'Get Recipient List from Source Item
Set myrecip = sourceitem.Recipients
'count the recipients
MyRecipNum = myrecip.Count
'If the recipients list is not empty
If MyRecipNum > 0 Then
'For Each Recipient Do the following:
For x = 1 To MyRecipNum
MyBodStr = MyBodStr & (vbCrLf & myrecip(x).Name)
'==========================================================================
'**************************************************************************
'==========================================================================
' Need Code Here to determine if recip is a DL and if so
' Enumerate the list to MyBodStr
'==========================================================================
'**************************************************************************
'==========================================================================
Next x
'If Myrecip =< 0
Else
MsgBox ("There are no Recipients in this message.")
End If
'Write Recipient information to DL
targetitem.Body = MyBodStr
targetitem.Display
End Sub
I hate to post the same question to two NG's but after posting the first one
it seems more appropriate to this NG.
I have been struggeling with this beast for some time now and have yet to
get this to work the way I would like..
I can get the recipients list and walk through it. The code below works.
However if I do MyRecipient.Members(x) I am unable to get a reliable count
or properly pull the name and address list values from them.
I have tried code similar to the following:
For i = 1 To myolsel.Count
Set myrecip = myolsel(i)
If myrecip.Recipients.AddressEntries.Members.Count > 1 Then
For Each entry In myrecip.Recipients.AddressEntry.Members
mystr = mystr & Chr$(13) + myrecip.AdressEntry.Members.Name
mystr = mystr & "; " & myrecip.AdressEntry.Members.Address
Next
End If
Next
This did not work either.
Any help would be greatly appreciated!!
Jeff
Here is my code as it stands.
===================================================
===================================================
Private Sub DLBreakout()
Dim MyBodStr As String
'Set Variable to select the default INBOX folder
Set myFolder = Session.GetDefaultFolder(olFolderInbox)
'Set variable to the (collection of) selected items in Inbox.
Set myolsel = Application.ActiveExplorer.Selection
'Set Source and Target forms
Set myolsel = Application.ActiveExplorer.Selection
Set targetitem = myFolder.Items.Add("ipm.note.dllist")
Set sourceitem = myolsel(1)
'Get Recipient List from Source Item
Set myrecip = sourceitem.Recipients
'count the recipients
MyRecipNum = myrecip.Count
'If the recipients list is not empty
If MyRecipNum > 0 Then
'For Each Recipient Do the following:
For x = 1 To MyRecipNum
MyBodStr = MyBodStr & (vbCrLf & myrecip(x).Name)
'==========================================================================
'**************************************************************************
'==========================================================================
' Need Code Here to determine if recip is a DL and if so
' Enumerate the list to MyBodStr
'==========================================================================
'**************************************************************************
'==========================================================================
Next x
'If Myrecip =< 0
Else
MsgBox ("There are no Recipients in this message.")
End If
'Write Recipient information to DL
targetitem.Body = MyBodStr
targetitem.Display
End Sub