keepITcool,
yes it does.
Thank you so much!!
MariaG
'=================================================
Subject: Re: Outlook vs Outlook Express
From: "keepITcool" <
[email protected]> Sent:
9/25/2004 5:07:58 AM
does this get you on your way?
Option Explicit
'ADVAPI32
Private Declare Function RegOpenKey Lib "advapi32.dll" _
Alias "RegOpenKeyA" (ByVal hKey As Long, _
ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" ( _
ByVal hKey As Long) As Long
Private Declare Function RegQueryValueEx
Lib "advapi32.dll" _
Alias "RegQueryValueExA" (ByVal hKey As Long, _
ByVal lpValueName As String, ByVal lpReserved As Long,
_
lpType As Long, lpData As Any, lpcbData As Long) As
Long
'**********************************************************
*****
'* REGISTRY
FUNCTIONS *
'**********************************************************
*****
Function GetRegString(hKey As Long, sPath As String, _
sValue As String) As String
Dim lRet&, sRet$
RegOpenKey hKey, sPath, lRet
If lRet <> 0 Then
sRet = GetRegQuery(lRet, sValue)
RegCloseKey lRet
GetRegString = sRet
Else
GetRegString = "error"
End If
End Function
Private Function GetRegQuery(ByVal hKey As Long, _
ByVal sValue As String) As String
Dim lRet&, sBuf$, cb&
cb = 256
sBuf = Space(cb)
lRet = RegQueryValueEx(hKey, sValue, 0, 0, ByVal sBuf,
cb)
If lRet = 0 Then
'Remove trailing chr(0)
If InStr(sBuf, vbNullChar) > 0 Then sBuf = Left(sBuf, _
InStr(sBuf, vbNullChar) - 1)
'Then trim spaces
GetRegQuery = Trim(sBuf)
End If
End Function
Function GetMailer() As String
Const HKCR = &H80000000
Dim sReg$
sReg = GetRegString
(HKCR, "mailto\shell\open\command", "")
If InStr(sReg, "msimn.exe") Then
GetMailer = "Outlook Express"
ElseIf InStr(sReg, "outlook.exe") Then
GetMailer = "Outlook"
ElseIf InStr(sReg, "hmmapi.dll") Then
GetMailer = "Hotmail"
Else
GetMailer = "Unknown : " & sReg
End If
End Function
keepITcool
< email : keepitcool chello nl (with @ and .) >
< homepage:
http://members.chello.nl/keepitcool >
MariaG said:
Does anyone know the code to tell if a user is using
Outlook or Outlook Express from within Excel's VBA modules?
I am sure there is something in the registry keys - would
that method okay?
Many thanks in advance.
MariaG
..