VB 6.0 - Accepting value (email address)from Inputbox

Reply

Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Solved Threads: 0
tgifgemini tgifgemini is offline Offline
Junior Poster

VB 6.0 - Accepting value (email address)from Inputbox

 
0
  #1
Jul 19th, 2007
Hi everyone,
I have included a "Send mail" module in my vb module, but I want to accept the email address from an input box instead of hard-coding the recipients email address because the recipient may be different each given time.
Below is my code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. SENDEMAIL:
  2. Set OutlookApp = CreateObject("Outlook.Application")
  3. Set OutlookMail = OutlookApp.CreateItem(0)
  4.  
  5. OutlookMail.To = "giftxtian@yahoo.com"
  6. OutlookMail.Subject = "Project Status"
  7. OutlookMail.Body = "This is VB email test"
  8.  
  9. If Len(MailAttach) = 0 Then
  10. OutlookMail.Attachments.Add MailAttach '"C:\ProjectStatus.xls"
  11. End If
  12.  
  13. OutlookMail.Display 'To display the email
  14. OutlookMail.Send 'To send the email

How can I imbed the input box in the above routine?
Thanks.
GiftX
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 49
Reputation: Mr.Wobbles is an unknown quantity at this point 
Solved Threads: 2
Mr.Wobbles Mr.Wobbles is offline Offline
Light Poster

Re: VB 6.0 - Accepting value (email address)from Inputbox

 
0
  #2
Jul 19th, 2007
you will need a textbox, in your form, and set the OutlookMail.To = to the textbox name and put a .text after it.

OutlookMail.To = textboxname.text
Mr.Wobbles~
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Solved Threads: 0
tgifgemini tgifgemini is offline Offline
Junior Poster

Re: VB 6.0 - Accepting value (email address)from Inputbox

 
0
  #3
Jul 19th, 2007
Actually,
I don't want a textbox control on my form. All my codes are embedded in a Command control which the users clicks and the whole process is executed.
Thanks anyway.
tgifgemini.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Solved Threads: 0
tgifgemini tgifgemini is offline Offline
Junior Poster

Look up email addresses from Outlook address book

 
0
  #4
Jul 19th, 2007
Hi
is there a posibility to do a look up and use email address from Outlook Address book - using VB6.?
tgifgemini
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: VB 6.0 - Accepting value (email address)from Inputbox

 
0
  #5
Jul 20th, 2007
Hi tgif,

In Command Click, before u call the above module use InputBox say,

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public EMailID as String
  2. EMailID = InputBox("Enter EMail ID")
  3. If Trim(EMailID) <> "" Then
  4. 'Call The Send Function
  5. End If
  6.  
  7. and change this to:
  8. OutlookMail.To = EMailID


Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Solved Threads: 0
tgifgemini tgifgemini is offline Offline
Junior Poster

Re: VB 6.0 - Accepting value (email address)from Inputbox

 
0
  #6
Jul 20th, 2007
QVeen72.
Thanks for your contribution. Your code seem pretty efficient.
Enjoy your day.
tgifgemini.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC