Dirk,
Maybe more than you want to know, but I've included here the module
documentation block that describes how I used Locati's kWAB.dll to
accomplish the task of converting recipient lists containing "WAB names"
to e-mail addresses, prior to using the "SendMailWithOE" facility to send
a zipped mdb to a distribution list.
Once again, I want to thank you for your help with this exercise.
Bill
Public Function Convert_Recipients_EMA(InString As String) As String
'================================================================
' InString originates from the current installations property sheet that
includes
' a list of recipients on distribution for the installations primary
database. The
' recipients are entered either as fully qualified e-mail addresses or names
as they
' appear in the current user's WAB, Windows Address Book. The recipients
names and/or
' e-mail addresses are delimited by ";", as is the usual syntax for a list
of recipients
' appearing in the recipient fields of both Outlook Express and Outlook.
'
' The input string is first parsed into an array of recipient entries using
the split
' function. Each element of the InStrArray is then either a name to be found
in the current
' WAB or an already fully qualified e-mail address. In any case, the various
functions
' provided by Michele Locati's (
[email protected]) kWAB.dll are employed
to obtain
' the name/address pairs from the current WAB. As each pair is returned, we
use the name
' as a search key into our InStrArray for a match. When a match is found, we
substitute
' the e-mail address for the name and mark the array element as being a
"hit". The process
' continues until either the WAB is exhausted or all the InStrArray elements
have received
' a "hit" status. ("hits" are indicated by a value of 1 in an array of
integers that
' essentially parallels our InStrArray being of the same dimension.)
'
' Before the function's return string is prepared, the number of recipients
is reconciled
' to the number of "hits". "non-hit" elements are issued via a MsgBox as an
error condition
' unless it is first found to be a fully qualified e-mail address, in which
case it is then
' marked as a hit. Thus, when all is said and done we either have a 100% hit
status or the
' user has errors that require his/her attention. When we have a "100% hit
condition", the
' return string is prepared by putting all of the e-mail addresses into the
string separated
' by the ";" delimiter.
'
' The kWAB.dll function invocations used to obtain the "name/e-mail address
pairs" below
' are in large part taken from the "Main.frm" code that accompanied the
"Simple" example
' downloaded from:
http://www.veign.com/vrc_codeview.asp?type=app&id=91
'
' (See general module ModkWAB for the function DIM's pertaining to kWAB.dll,
as taken from
' kWAB.bas)
'==================================================================