I need help finding email client name

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

Bill

Does anyone know how to obtain the name of the current
user's e-mail client from VBA code? E.g., "Outlook",
"Outlook Express", etc.

Thanks,
Bill
 
Bill said:
Does anyone know how to obtain the name of the current
user's e-mail client from VBA code? E.g., "Outlook",
"Outlook Express", etc.
Hi,

Read the default value under the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail
 
Thanks! Do you know how to read a Registry value
from VBA code? That's the task I have.
Thanks again,
Bill
 
Bill said:
Thanks! Do you know how to read a Registry value
from VBA code? That's the task I have.
Thanks again,
Bill
Hi,

Use the RegRead method of the WshShell object in the Windows Script
Host (WSH) Object Model:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
sDefaultMail = oShell.RegRead("HKLM\SOFTWARE\Clients\Mail\")
MsgBox sDefaultMail
'--------------------8<----------------------


WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp
 
Thanks Torgeir, I'm sure there's a VBA couter-part to the Script
code you sent. If not, I have the Script Host and will use the code
you sent.
Thanks again,
Bill
 
Bill said:
Thanks Torgeir, I'm sure there's a VBA couter-part to the Script
code code you sent. If not, I have the Script Host and will use
the you sent.
Hi,

The code I posted ran successfully in a Excel macro I created...
 
Torgeir, from your macro example, I created a
simple function:
====================================
Public Function GetDfltEmailClient() As String
Dim objShell As Object

Set objShell = CreateObject("WScript.Shell")
GetDfltEmailClient = objShell.RegRead("HKLM\SOFTWARE\Clients\Mail\")
End Function
====================================
I've posted elsewhere a question relating to the down-side
of coding with a dependency on the Script Host, as I can't
guarantee exactly where the code might run. It's not likely
that anything older than a 98SE with Office2000 system
would be encountered, but I'd like the experience of other
major Access users.

Thanks again for your thoughts and suggestions.

Bill
 
Bill said:
Torgeir, from your macro example, I created a
simple function:
====================================
Public Function GetDfltEmailClient() As String
Dim objShell As Object

Set objShell = CreateObject("WScript.Shell")
GetDfltEmailClient = objShell.RegRead("HKLM\SOFTWARE\Clients\Mail\")
End Function
====================================
I've posted elsewhere a question relating to the down-side
of coding with a dependency on the Script Host, as I can't
guarantee exactly where the code might run. It's not likely
that anything older than a 98SE with Office2000 system
would be encountered, but I'd like the experience of other
major Access users.

Thanks again for your thoughts and suggestions.
Hi,

For 98SE and newer, the code should work fine.

For older than 98SE, as long as Internet Explorer 5.01 or newer
is installed, it will also work fine.
 

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