OK this isnt a seasy as it looks! I've checked out the FAQ sections but I still cant figure out why the following code doesnt work:
Private Sub cmdEmail_Click()
Dim olookApp As Outlook.Application
Dim olookMsg As Outlook.MailItem
Dim olookRecipient As Outlook.recipient
'create the outlook session
Set olookApp = CreateObject("Outlook.Application"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
'create the message
Set olookMsg = olookApp.CreateItem(olMailItem)
With olookMsg
' put in the adressee
Set olookRecipient = .Recipients.Add("fred.bloggs@bloggs.com"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
olookRecipient.Type = olTo
.subject = "This is a test!"
.body = "Cant promise this will be the last test! The first of many!" & vbCrLf
.Display
End With
End Sub
I have checked the MS Outlook 9.0 Reference. Does it's priority matter? When I tried declaring objects in the parenthesis after the "Private Sub" etc and then tried opening the Form I was prompted to enter a parameter. Any ideas...?
Private Sub cmdEmail_Click()
Dim olookApp As Outlook.Application
Dim olookMsg As Outlook.MailItem
Dim olookRecipient As Outlook.recipient
'create the outlook session
Set olookApp = CreateObject("Outlook.Application"
'create the message
Set olookMsg = olookApp.CreateItem(olMailItem)
With olookMsg
' put in the adressee
Set olookRecipient = .Recipients.Add("fred.bloggs@bloggs.com"
olookRecipient.Type = olTo
.subject = "This is a test!"
.body = "Cant promise this will be the last test! The first of many!" & vbCrLf
.Display
End With
End Sub
I have checked the MS Outlook 9.0 Reference. Does it's priority matter? When I tried declaring objects in the parenthesis after the "Private Sub" etc and then tried opening the Form I was prompted to enter a parameter. Any ideas...?