J
Jake
I'm looking to learn CDO, and my first very basic question: How do I make it run? I've keyed the following code into the Visual Basic editor (my first mistake?), and can't even start it due to MAPI.Session not being recognized. I have checked the references for "CDO for Windows 2000 Library" and "CDO for NTS 1.2 Library"...do I need any others?
Dim objSession As Mapi.Session
Dim objMessage As Message
Dim objOneRecip As Recipient
Set objSession = CreateObject("MAPI.Session")
objSession.Logon "MS Exchange Settings"
Set objMessage = objSession.outbox.Message.Add
objMessage.Subject = "Test Subject"
objMessage.Text = "Test text"
Set AddressList = objSession.AddressLists(1)
Set objOneRecip = objMessage.Recipients.Add
objOneRecip.Name = AddressList.AddressEntries(1)
objOneRecip.Type = 1
objOneRecip.Resolve
objMessage.Display
objMessage.Send False
objSession.Logoff
Thanks!
Jake
Dim objSession As Mapi.Session
Dim objMessage As Message
Dim objOneRecip As Recipient
Set objSession = CreateObject("MAPI.Session")
objSession.Logon "MS Exchange Settings"
Set objMessage = objSession.outbox.Message.Add
objMessage.Subject = "Test Subject"
objMessage.Text = "Test text"
Set AddressList = objSession.AddressLists(1)
Set objOneRecip = objMessage.Recipients.Add
objOneRecip.Name = AddressList.AddressEntries(1)
objOneRecip.Type = 1
objOneRecip.Resolve
objMessage.Display
objMessage.Send False
objSession.Logoff
Thanks!
Jake