By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

DAPs - Create a command button that will send an email through default mail client

P: 579
I have a DAP that I've added a command button to (and by default is set to be coded using vbscript, but I'll use whatever works). The command button uses the onclick method to look at a dropdown list, see if there's anything in it, and return a message as output to the monitor.

This part works great. My main goal, however, is to get the script, once it's displayed the message on the screen, to open the default email client and start an email message. Kind of like the mailto: tag will do...

Here's what I have so far:
Expand|Select|Wrap|Line Numbers
  1. <script language=vbscript event=onclick for=command1>
  3. if dropdownlist0.value = "" then
  4.   msgbox "Please select an instructor"
  5. else if dropdownlist0.value = "Instructor 1" then
  6.   msgbox "You selected Instructor 1"
  7. elseif dropdownlist0.value = "Instructor 2" then
  8.   msgbox "You selected Instructor 2"
  9. end if
  11. </script>
Ultimately, I'm trying to create a quiz that will email your scores to the instructor that you chose from the dropdown list once you click on submit.

We use Microsoft Outlook on the Exchange Server at my work.
Aug 20 '08 #1
Share this Question
Share on Google+
2 Replies

P: 98
I'm doing a little research on this matter to help you out, but here's for starters...
You're going to have to open Outlook to send an email, no question about that.
Here's a way to do it (this part would go in your command button portion)
Example Default Location:
Expand|Select|Wrap|Line Numbers
  1. Shell ("C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE")
Of course, this is only to open the program itself. Creating a new message with subject / body insertions is a little more tricky. I'll have more info ASAP.

Nov 3 '08 #2

P: 98
Here's something I came across for email using Access VBA... Might want to give a look at it.
Nov 3 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.