Sign in with
Sign up | Sign in
Your question

I need help finding email client name

Last response: in Windows XP
Share
July 2, 2005 2:21:41 AM

Archived from groups: microsoft.public.windowsxp.general (More info?)

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

More about : finding email client

Anonymous
July 3, 2005 1:14:52 AM

Archived from groups: microsoft.public.windowsxp.general (More info?)

Bill wrote:

> 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


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
July 3, 2005 1:33:41 AM

Archived from groups: microsoft.public.windowsxp.general (More info?)

Thanks! Do you know how to read a Registry value
from VBA code? That's the task I have.
Thanks again,
Bill


"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:%23RwlJszfFHA.2372@TK2MSFTNGP14.phx.gbl...
> Bill wrote:
>
>> 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
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
Related resources
Anonymous
July 3, 2005 3:59:28 AM

Archived from groups: microsoft.public.windowsxp.general (More info?)

Bill wrote:

> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote:
>> Bill wrote:
>>
>>> 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.
>>
>>
>> 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
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



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
July 3, 2005 9:26:27 AM

Archived from groups: microsoft.public.windowsxp.general (More info?)

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



"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:%23mRIJI1fFHA.3256@TK2MSFTNGP12.phx.gbl...
> Bill wrote:
>
>> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote:
>>> Bill wrote:
>>>
>>>> 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.
>>>
>>>
>>> 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
> 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
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
Anonymous
July 3, 2005 9:11:23 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

Bill wrote:

> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote:
>> Bill wrote:
>>>
>>> Thanks! Do you know how to read a Registry value
>>> from VBA code? That's the task I have.
>>
>> 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<----------------------
>>
>
> 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, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
July 4, 2005 2:59:11 AM

Archived from groups: microsoft.public.windowsxp.general (More info?)

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



"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:%23B2duH%23fFHA.1148@TK2MSFTNGP12.phx.gbl...
> Bill wrote:
>
>> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote:
>>> Bill wrote:
>>>>
>>>> Thanks! Do you know how to read a Registry value
>>>> from VBA code? That's the task I have.
>>>
>>> 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<----------------------
>>>
>>
>> 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, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
Anonymous
July 4, 2005 3:58:34 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

Bill wrote:

> 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.


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
!