I am trying to send an email with VB but am getting stuck on the dim. It stops at the first line:
dim olapp as Outlook.Application
and returns the message: User-defined type not defined
Is there a component or reference I need to add to my program in order for this to work? I have a different way of getting the email ready, by using:
'ShellExecute ByVal 0&, vbNullString, str, vbNullString, "C:\", SW_SHOWNORMAL
with my parameters but I can not figure out if there is a way for it to automatically send. So I'm looking through previous posts and I came across the example:
dim olapp as Outlook.Application
dim olmsg As Outlook.MailItem
olmsg.Recipients.Add "Recipients"
olmsg.Attachments.Add "c:\test.txt"
olmsg.Subject = "Subject"
olmsg.Body = "Body"
olmsg.send
I see it should be easy to send a "send" command but I'm getting hung up. Any ideas? Thanks!
2007-02-28
06:23:54
·
2 answers
·
asked by
Donderman
1
in
Computers & Internet
➔ Programming & Design