Solved

vba code to find default email program

Posted on 2011-02-20
6
517 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 250 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
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!

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

717 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