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:

Set OutlookApp = CreateObject("Outlook.Application")
 Set OutlookMail = OutlookApp.CreateItem(Outlookmailitem)
 
 OutlookMail.To = "giftxtian@yahoo.com"
 OutlookMail.Subject = "Project Status"
 OutlookMail.Body = "This is VB email test"
 
 If Len(MailAttach) = 0 Then
    OutlookMail.Attachments.Add "C:\ProjectStatus.xls"
 End If
 
 OutlookMail.Display      'To display the email
 OutlookMail.Send         'To send the email
    
 Set OutlookApp = Nothing
 Set OutlookMail = Nothing

what is the correct code syntax to accomplish the objective?
Thanks.
tgifgemini

Hi Jireh,
no I am using vb 6.0
Thanks.
tgifgemini

I have list of emails and password in excel . Can I pass the value to outlook and receiveing mail in same inbox to all email accounts

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.