Solved

vba code to find default email program

Posted on 2011-02-20
6
404 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
  • 3
  • 2
6 Comments
 
LVL 37

Accepted Solution

by:
Neil Russell earned 250 total points
Comment Utility
'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
Comment Utility
What if email program is other than Microsoft like lotus notes,GroupWise,etc.?
0
 
LVL 37

Expert Comment

by:Neil Russell
Comment Utility
Then change   If RegKey = "Microsoft Outlook" Or RegKey = "Outlook Express" Thento what you want to find.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:dev00790
Comment Utility
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
Comment Utility
The info is stored in the registry so no
0
 

Author Comment

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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now