Webmasters, gagnez de l'argent en affichant des bannières contextuelles Oxado
SourceForge.net Logo
Support This Project Free Downloads
WABAccess Project
Welcome ! [ Home ]  ·  [ Downloads ]  ·  [ Forums ]  ·  [ News ]  ·  [ Documentations ]  
[ Home ]

[ Documentations ]

Selecting Recipients


The ShowAddress method can be used to select contact and distribution list by the user. The method return a Recipients collection. Each entry of the Recipients collection has a wabPR_RECIPIENT_TYPE property which contain a value of the enumRecipientType enumeration. You can controls the presentation and behavior of the dialog box with the parameters of the function.  If the user click on Cancel button the method raise the MAPI_E_USER_CANCEL error.

Dim objSession, objRecipients, objEntry

Const PR_RECIPIENT_TYPE = &H0C150003

OpenWab

Set objRecipients = objSession.NewRecipients()

objRecipients.Add objSession.Containers(1).Elements(1), 1 ' add a selected "TO" recipient 
objRecipients.Add objSession.Containers(1).Elements(1), 2 ' add a selected "CC" recipient 

Set objRecipients = objSession.ShowAddress("Choose contact and distribution list",False,False, _
			True,2,"Select To","Select CC",,,objRecipients)

MsgBox "The user choose " & objRecipients.Count & " entries"
For i=objRecipients.Count to 1 step -1
	Set objEntry = objRecipients.Item(i)
	MsgBox "Recipient type is " & objEntry.Properties(PR_RECIPIENT_TYPE).Value _
		& " of the entry " & objEntry.Name
Next

objRecipients.Remove 1
objRecipients.Remove "1"

MsgBox "The user choose " & objRecipients.Count & " entries"
For Each objEntry In objRecipients
    MsgBox "Recipient type is " & objEntry.Properties(PR_RECIPIENT_TYPE).Value _
    	& " of the entry " & objEntry.Name
Next

objRecipients.Clear

CloseWab

WABAccess