• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 467
  • Last Modified:

How to determine type of email client is installed using VBA

Hello,

I am working on an Access 2007 application where I have installed a generic error handler.  There is a email function that I am trying to implement that will email a report.  I know how to use either outlook or lotus notes to send email via automation from access.  However, I want to be determine what type of email client is installed.  For example, if a user has Lotus Notes installed, the report would be sent via lotus note, if a user has outlook installed, the report would be sent via outlook.  How do I determine the mail client that is installed on a machine via vba.  I'm thinking it might require a windiows api call
0
chtullu135
Asked:
chtullu135
  • 2
2 Solutions
 
GlobaLevelCommented:
vba and vbscript:
http://windowssecrets.com/forums/showthread.php/37290-Detecting-email-client-(VB-6-Access-97)

<pre>Sub GetMailClient()
Dim RegVal As String, MailProg As String
Dim CharPos As Integer, RegValLength As Integer
Dim WshShell
Set WshShell = CreateObject("Wscript.shell")
RegVal = WshShell.regread("HKEY_CLASSES_ROOTmailtoshellopen command")
Set WshShell = Nothing
RegValLength = Len(RegVal)
For CharPos = RegValLength To 0 Step -1
On Error Resume Next 'In case there's no path
If Mid(RegVal, CharPos, 1) = "" Then
MailProg = Mid(RegVal, CharPos + 1)
Exit For
End If
Next CharPos
RegValLength = Len(MailProg)
For CharPos = 1 To RegValLength Step 1
If Mid(MailProg, CharPos, 1) = "." Then
MailProg = Mid(MailProg, 1, CharPos + 3)
Exit For
End If
Next CharPos
MailProg = """" & MailProg & """" 'enclose in quotes just in case of long filename
MsgBox "Your default e-mail client is: " & MailProg
End Sub
</pre>

Open in new window

0
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
0
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
There is a reg key for this. I could not get GlobaLevel's code to work.

 reg key
0
 
chtullu135Author Commented:
Thanks for the info.  I'm sorry for the delay in responding,  I'm in the process of addressing some other issues concerning another database.  I'll get back to this problem in a day.  
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now