Randy Birch's site (which is where Brendan sent you) is aimed at VB
programmers. There are significant differences between the controls
available for forms in VB and in Access, so often Randy's examples don't
port cleanly into Access. You, unfortunately, have found one such example.
The easiest thing to do with be to remove those 2 calls to Send Message.
If you're using Access 2002 or newer, define your listbox to have 2 columns.
Change all of the AddItem lines from something like:
List1.AddItem "Registry Name" & vbTab & .OlRegistryName
to something like:
List1.AddItem "Registry Name;" & .OlRegistryName
If you're using Access 2000 or earlier, you can't use the AddItem method
anyhow. You'll have to change all of the AddItem lines to something like:
Debug.Print "Registry Name" & vbTab & .OlRegistryName
You can then look in the Immediate Window (Ctrl-G) to see what's printed
there.
The only point of Randy's example is to show you the various values that are
returned by the API calls. Once you know which value you need, you'll simply
refer to olData.OlSmtpServer, or whatever fields it is you decide you need.