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

vba code to find default email program

What is the line of code to detect which email program a user use?I'm
The email is opened thru a web portal.There is a spreadsheet attached .There is a send button in the spreadsheet with a specific address to mail to. In my test,when I clicked it,I noticed that there is no send button in the email program that opened.That PC I used had Outlook installed.It seemed that it could not find the email program.
  • 3
  • 2
1 Solution
Neil RussellTechnical Development LeadCommented:
'reads the value for the default email client
'if the key cannot be found, the return value is ""
Dim myWS As Object
Dim RegKey As String
Dim Key As String

  On Error Resume Next
  'access Windows scripting
  Set myWS = CreateObject("WScript.Shell")
  'read key from registry
  RegKey = myWS.RegRead(Key)
  If RegKey = "Microsoft Outlook" Or RegKey = "Outlook Express" Then
    Call show_email_buttons
    Call hide_email_buttons
  End If


zachvaldezAuthor Commented:
What if email program is other than Microsoft like lotus notes,GroupWise,etc.?
Neil RussellTechnical Development LeadCommented:
Then change   If RegKey = "Microsoft Outlook" Or RegKey = "Outlook Express" Thento what you want to find.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

As a side question - when the registry is locked down, so that a User does not have access to it, is there an alternate method for finding the email program?
Neil RussellTechnical Development LeadCommented:
The info is stored in the registry so no
zachvaldezAuthor Commented:
Just to apply to all possible email programs.....,the developer may not cover all it?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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