Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 30th, 2005, 03:04 PM
Authorized User
 
Join Date: Sep 2004
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default Email Link in Msgbox function

I am trying to provide an email link when I display a message with MsgBox function - that is, when user clicks the link, they can email to the email link. How do I do that, or can I do that?

Thanks.

Reply With Quote
  #2 (permalink)  
Old March 31st, 2005, 08:22 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You need to give the user a choice of buttons, one for Ok, the other for Cancel (vbOKCancel). Then, check the button choice. If they choose Cancel, then end the script. If they choose OK, then make a call to the proper application to generate the email with the address and perhaps subject line already filled. That will depend on which application object you are using for email.

You can also prompt the user for the email information (Subject line, message, etc), using input boxes, and then package and send the email using an SMTP emailer.

HTH

mmcdonal
Reply With Quote
  #3 (permalink)  
Old March 31st, 2005, 09:20 AM
Authorized User
 
Join Date: Sep 2004
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the info.

I'm more thinking about doing HTML thru msgbox - display a string of message or text, then provide link to other pages with "<A></A>" tag, which also includes something like "mailto:".

Is this possible at all?

Reply With Quote
  #4 (permalink)  
Old March 31st, 2005, 01:23 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

In VB you can “override” VB functions by writing your own in a module within the project. VB automatically checks project resources before checking VB's libraries.
That would allow you to write your own MsgBox function that displays your own form as a “message box.” If you wanted to, you could put a text field (label, button, textbox, ...) on the form's face that effectively operates as a hyperlink.

I don’t think you’ll be able to do this in VBScript.

I believe your only approach for this is going to be either to let the button the user selects control the behavior of the script to enable sending mail through code (as mmcdonal suggested), or write a “message box” html document with the email link in it, and display that HTML document in an internet browser instead of showing a message box. (Of course, that would not be modal, as a message box is...)

There is one other thing that you could do, the process of which I’m not sure of: Write a true VB ActiveX DLL that presents a VB form with the e-mail link on it as the action of a function in the DLL. When you call the function (which I’m not sure how you do in VBScript) the call would be synchronous, giving you the ability to mimic a modal dialog. You could write the function to take all the e-mail details as arguments. Just a thought.
Reply With Quote
  #5 (permalink)  
Old March 31st, 2005, 02:21 PM
Authorized User
 
Join Date: Sep 2004
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'll think about the second approach you suggested - that's also what's in my mind. Thank you.

Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Open link automatically in email collie HTML Code Clinic 2 May 28th, 2008 09:57 PM
How to give the link to file through the email pushpa BOOK: Beginning ASP 3.0 0 May 1st, 2007 02:31 AM
Gridview Email Link ronhawker General .NET 0 November 9th, 2006 07:12 PM
Msgbox Function Problem theokrtz Classic ASP Basics 4 July 4th, 2006 03:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.