Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

vba code to find default email program

Posted on 2011-02-20
6
Medium Priority
?
627 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:zachvaldez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 37

Accepted Solution

by:
Neil Russell earned 1000 total points
ID: 34937276
'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

Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\"
 
  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
 
  Else
 
    Call hide_email_buttons
 
  End If

From

http://www.access-programmers.co.uk/forums/showthread.php?t=146950
0
 

Author Comment

by:zachvaldez
ID: 34937309
What if email program is other than Microsoft like lotus notes,GroupWise,etc.?
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34937393
Then change   If RegKey = "Microsoft Outlook" Or RegKey = "Outlook Express" Thento what you want to find.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Expert Comment

by:dev00790
ID: 34937434
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?
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34938105
The info is stored in the registry so no
0
 

Author Comment

by:zachvaldez
ID: 34938648
Just to apply to all possible email programs.....,the developer may not cover all it?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a serious pitfall that can happen when deleting shapes using VBA.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question