Solved

vba code to find default email program

Posted on 2011-02-20
6
467 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

Industry Leaders: 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!

Question has a verified solution.

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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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