Detecting Distribution/Mailing List in contacts

  • Thread starter Thread starter Outlook Worm
  • Start date Start date
O

Outlook Worm

Hi,

How can i check in VBScript behind Outlook that user has entered some
distribution/mailing list in the 'To' field ? Also it does not get
resolved automatically. Please advise.

Khan G
 
VBScript in a custom form? It would have to be that for VBScript to be able
to run in that context.

Function Item_Send()
Dim colRecips
Dim oRecip

Const olPrivateDistList = 5
Const olDistList = 1

Set colRecips = Item.Recipients
For Each oRecip In colRecips
If (oRecip.DisplayType = olDistList) Or (oRecip.DisplayType =
olPrivateDistList) Then
'this is a distribution list

Secure versions of Outlook will show the security prompt when you access the
Recipients collection of the item however, unless the form is published and
you're using Outlook 2003 or you take steps to avoid the security prompts by
using Redemption code (www.dimastr.com/redemption).

If the DL is valid it should resolve when the user sends the item or uses
Alt+K or Ctrl+K. Have them do that and see where the resolution fails.
 
If (oRecip.DisplayType = olDistList) Or (oRecip.DisplayType =
olPrivateDistList) Then

never returns TRUE so it never gets in to this. It always seems to
return 0 as DisplayType.

Please help

Khan G
 
Also Please let me know how to extract member emails of the distribution
lists created in local contacts folder.

Khan G
 
Back
Top