Finding the OUTLOOK SMTP server from code?

  • Thread starter Thread starter Rico
  • Start date Start date
Hey Brendan,

I tried the code, but it's giving me an error on the List1.hwnd line stating
"Member or data method not found". Any ideas?

Rick
 
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.
 
Excellent! Thanks for the clarification Douglas. I'm using A2k2, so I
shouldn't have too much difficulty changing things as you've suggested.

Thanks again!
Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top