User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 391,563 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,705 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 3259 | Replies: 5
Reply
Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Sponsor
tgifgemini tgifgemini is offline Offline
Junior Poster

VB 6.0 - Accepting value (email address)from Inputbox

  #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:
SENDEMAIL:
 Set OutlookApp = CreateObject("Outlook.Application")
 Set OutlookMail = OutlookApp.CreateItem(0)
 
 OutlookMail.To = "giftxtian@yahoo.com"
 OutlookMail.Subject = "Project Status"
 OutlookMail.Body = "This is VB email test"
 
 If Len(MailAttach) = 0 Then
    OutlookMail.Attachments.Add MailAttach  '"C:\ProjectStatus.xls"
 End If
 
 OutlookMail.Display      'To display the email
 OutlookMail.Send         'To send the email

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

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

  #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  
Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Sponsor
tgifgemini tgifgemini is offline Offline
Junior Poster

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

  #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  
Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Sponsor
tgifgemini tgifgemini is offline Offline
Junior Poster

Look up email addresses from Outlook address book

  #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  
Join Date: Nov 2006
Posts: 692
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 94
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Master Poster

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

  #5  
Jul 20th, 2007
Hi tgif,

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

Public EMailID as String
EMailID = InputBox("Enter EMail ID")
If Trim(EMailID) <> "" Then
   'Call The Send Function
End If
 
and change this to:
OutlookMail.To = EMailID


Regards
Veena
Reply With Quote  
Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Sponsor
tgifgemini tgifgemini is offline Offline
Junior Poster

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

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

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 10:04 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC