Using SendMailWithOE

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

In using Lyle Fairfield's SendMailWithOE, I discovered
that WAB names are not supported. I.e., one must use
a fully qualified e-mail address rather than a name taken
from the Windows address book. With that, is there an
Access interface to WAB's such that one could get the
fully qualified e-mail address given a WAB contact name?

Thanks,
Bill
 
Bill said:
In using Lyle Fairfield's SendMailWithOE, I discovered
that WAB names are not supported. I.e., one must use
a fully qualified e-mail address rather than a name taken
from the Windows address book. With that, is there an
Access interface to WAB's such that one could get the
fully qualified e-mail address given a WAB contact name?

I thought there would be, but I can only find a mechanism for reading
the Outlook/Exchange address book -- and I think that may be blocked by
recent security measures (though I'm not sure).

I googled around a bit, out of curiosity, and did find this:

http://www.veign.com/vrc_codeview.asp?type=app&id=91

Note that I'm not vouching for it; it's just what I turned up that
looked like the sort of thing you're after.
 
Dirk,
I've downloaded the package you found. It's late, so I'll look at
the "readme.txt" tomorrow (Friday) to see if it can be dovetailed
into the VBA of my current application project.

I'll post back when I find out more.

Thanks,
Bill
 
Dirk,
I downloaded and un-zipped the package you found on
Thursday. There's no documentation nor anything that
seems to be in a form that can be imported into an Access
database. There are two executables that display a form, of
sorts, and does in fact read my WAB file and fill out the
form with names and corresponding e-mail addresses. If
the package is intended to be used wherein a user can
interface to the package from VBA using a function
method, I haven't been able to detect it.

If you have nothing better to do, you might give a fast look
at what is in the zip file and maybe you can see how a user
could make use of its facilities from code.

Thanks,
Bill
 
Bill said:
Dirk,
I downloaded and un-zipped the package you found on
Thursday. There's no documentation nor anything that
seems to be in a form that can be imported into an Access
database. There are two executables that display a form, of
sorts, and does in fact read my WAB file and fill out the
form with names and corresponding e-mail addresses. If
the package is intended to be used wherein a user can
interface to the package from VBA using a function
method, I haven't been able to detect it.

If you have nothing better to do, you might give a fast look
at what is in the zip file and maybe you can see how a user
could make use of its facilities from code.

Bill, I've looked at it. The package contains the DLL itself as kind of
a "black box" that we can't see inside, and a couple of VB programs that
declare and call functions in the DLL. There is source code for those
VB programs, so using Visual Studio I was able to get in and see how the
DLL is called. If you, too, can get to the source code, the VB code
that actually calls the DLL's functions should be easy to copy and
incorporate in your Access VBA modules.

Do you need help with this? I only have a very limited amount of time
available for this sort of thing.
 
Doesn't sound too complicated, though I don't have Visual
Studio. Is the "Simple.vbp" and/or "Full.vbp" the file(s) you're
talking about? If so, can I somehow open that with VBA?

And no, I don't want you to spend much time on this. If I
can just get to the VB source code, I'm sure I can take it
from there.

Bill
 
Bill said:
Doesn't sound too complicated, though I don't have Visual
Studio. Is the "Simple.vbp" and/or "Full.vbp" the file(s) you're
talking about?

Not them, so much, as the files that are in the "Moduli" and "Maschera"
folders that are unpacked below those files.
If so, can I somehow open that with VBA?

You may be able to import the .bas files directly into your VBA
project -- I'm not sure if some modifications may be necessary or not.
The .frm files, which contain the code to actually call the functions,
can't be imported directly, but you can open them in Notepad and copy
the relevant code and paste it into your project, or just see what they
do.
And no, I don't want you to spend much time on this. If I
can just get to the VB source code, I'm sure I can take it
from there.

If need be, both the .bas files and the .frm files can be opened in
Notepad.
 
Dirk,
As I look at Main.frm in the Simple_Source folder, it appears
to have the VB code necessary to obtain contact names and
their corresponding e-mail addresses. I'm not all familiar with
the business of data typing that appears in the accompanying
bas file nor the Declares. Moreover, if the data typing needs
to be included in the VBA code. With that, I'm not sure how much
of any of that needs to be copied into a general module in
Access in order to run the kWAB functions.

I'll study it some more to see if I can figure out what he's doing
and proceed accordingly.

Looks like I've really opened a "can of worms" for myself, but
somewhat encouraged that there may be a way of solving the
need.

Thanks,
Bill
 
I'm making some progress, having created a "main" frm
and matched what the author had in the way of a simple
form. When I click on the Go command button, I get
an Access runtime error of can't find kWAB.dll. However,
I have it in the same folder as the new mdb... my study
continues.

Bill
 
BINGO!!!!!!!!!!
I now have a running Access/VBA version of the kWAB
simple "Main" form (frmMain). Unlike what the note.txt
says, the dll has to be in the Windows\System32 folder
in order that it run properly.

Great learning experience, thanks to you Dirk. I'll post
back after I have something worth sharing.

Bill
 
Dirk,
When I see the statements:

Public Type tWab
AddrBook As Long
WabObject As Long
InstWab As Long
End Type

Is that like tWAB defines a "structure" of a file record?

Bill
 
Bill said:
Dirk,
When I see the statements:

Public Type tWab
AddrBook As Long
WabObject As Long
InstWab As Long
End Type

Is that like tWAB defines a "structure" of a file record?

Not of a file record, necessarily, and probably not in this case. But
it is defining a structure that can be allocated in memory by a
statement such as

Dim MyVar As tWab

and have its elements referred to using a dotted notation; e.g.,
"MyVar.AddrBook = ...":. In this case, though, I'd expect that those
element, Long values all, are really memory pointers of some sort, ad
manipulated only by routines in the DLL.

If you aren't familiar with user-defined types in VB, you can read about
them in the online help, if you open it from the VB Editor environment.
 
Bill said:
BINGO!!!!!!!!!!
I now have a running Access/VBA version of the kWAB
simple "Main" form (frmMain).

Great! Well done.
Unlike what the note.txt
says, the dll has to be in the Windows\System32 folder
in order that it run properly.

That surprises me a little. I tried running the compiled "Full.exe"
program, and found that putting the DLL in the same folder with the
executable was sufficient.
Great learning experience, thanks to you Dirk. I'll post
back after I have something worth sharing.

Please do. This has been an interesting exercise.
 
Dirk,
I hand-wrote some code today while sitting in waiting rooms
and will get back to this in a day or so... tonight is clone discs
night in preparation for another machine coming online.

I'll post back with the final product.

Bill
 
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)
'==================================================================
 
Bill said:
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.

Thanks for the followup, Bill. I'm glad I was able to put you on the
right track.
 
Back
Top