| | |
VB6 - Email attachment not working
![]() |
•
•
Join Date: Jul 2007
Posts: 113
Reputation:
Solved Threads: 0
VB6 - Email attachment not working
Hi,
I wrote this program to send email through VB. The email is working okay but the attachment I need to attach to the email is not being attached.
See my codes below:
Any assistance will be appreciated.
tgifgemini
Hi,
I wrote this program to send email through VB. The email is working okay but the attachment I need to attach to the email is not being attached.
See my codes below:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Set OutlookApp = CreateObject("Outlook.Application") Set OutlookMail = OutlookApp.CreateItem(0) Set NSpace = OutlookApp.GetNamespace("MAPI") Set OutlookContacts = NSpace.GetDefaultFolder _(olFolderContacts).Items MailAttach = "C:\ProjectStatus.xls" <-- This spreadsheet resides in my hard drive. OutlookMail.To = EmailID 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 Set OutlookApp = Nothing Set OutlookMail = Nothing
Any assistance will be appreciated.
tgifgemini
Hi,
along with the above code, Create a seperate Attacmnet object, check this code:
Regards
Veena
along with the above code, Create a seperate Attacmnet object, check this code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim OAttach As Outlook.Attachment If Not IsMissing(MailAttach) Then Set OAttach = OutLookMail.Attachments.Add(MailAttach) End If
Regards
Veena
•
•
Join Date: Jul 2007
Posts: 113
Reputation:
Solved Threads: 0
Thanks for your expertise. My attachment is working now. However, I have one minor problem. See my follow-up post regarding RT Error: 424 object required.
My code bummed out on this line:
Thanks again,
tgifgemini.
My code bummed out on this line:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
lvw.ListItems.Add , , OutlookAddressEntry.Name
tgifgemini.
•
•
Join Date: Jul 2007
Posts: 113
Reputation:
Solved Threads: 0
In my perception, I have dimensioned the object below, but have not set it; To what should I set it?
You can see all the previous code you gave me.
tgifgemini.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim OutlookAddressEntry As Outlook.AddressEntry Set OutlookAddressEntry = ????????????? <== This maybe my problem
You can see all the previous code you gave me.
tgifgemini.
![]() |
Similar Threads
- send email with attachment (PHP)
- VB6 - Look up email address from outlook address book? (Visual Basic 4 / 5 / 6)
- How do i Send and Receive Email with Attachment (Visual Basic 4 / 5 / 6)
- email attachment (Visual Basic 4 / 5 / 6)
- Transfering email attachment to DVD? (Windows NT / 2000 / XP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: referential integrity in access DB
- Next Thread: Optimizing text file writing in VB 6.0
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





