Send Outlook email thru VB

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
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

Send Outlook email thru VB

 
0
  #1
Jul 17th, 2007
Hello everyone,
I have an exce spreadsheet called "ProjectStatus.xls" in my local folder "C:\ProjectStatus.xls".
I need to send it as an attachment to someone and I am using these codes:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Set OutlookApp = CreateObject("Outlook.Application")
  2. Set OutlookMail = OutlookApp.CreateItem(Outlookmailitem)
  3.  
  4. OutlookMail.To = "giftxtian@yahoo.com"
  5. OutlookMail.Subject = "Project Status"
  6. OutlookMail.Body = "This is VB email test"
  7.  
  8. If Len(MailAttach) = 0 Then
  9. OutlookMail.Attachments.Add "C:\ProjectStatus.xls"
  10. End If
  11.  
  12. OutlookMail.Display 'To display the email
  13. OutlookMail.Send 'To send the email
  14.  
  15. Set OutlookApp = Nothing
  16. Set OutlookMail = Nothing

what is the correct code syntax to accomplish the objective?
Thanks.
tgifgemini
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 300
Reputation: jireh is an unknown quantity at this point 
Solved Threads: 43
jireh's Avatar
jireh jireh is offline Offline
Posting Whiz

Re: Send Outlook email thru VB

 
0
  #2
Jul 17th, 2007
Are you using vb.net?
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: Send Outlook email thru VB

 
0
  #3
Jul 18th, 2007
Hi Jireh,
no I am using vb 6.0
Thanks.
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:




Views: 5764 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC