Here is my code, It's a bit messy but I still get a "Object Required" 424 at the "With", I can't see where I'm going wrong, because I'm new to this, can you help me please??
Private Sub Command23_Click()
Dim db As DAO.Database
Dim MailList As DAO.Recordset
Dim MyOutlook As Outlook.Application
Dim MyMail As Outlook.MailItem
Dim Subjectline As String
Dim BodyFile As String
Dim MyBodyText As String
Dim rsemail As DAO.Recordset
Dim ns As Outlook.NameSpace
Dim Folder As Outlook.MAPIFolder
Dim mysql As String
Subjectline$ = "News Letter"
DoCmd.SetWarnings False
Set MyOutlook = New Outlook.Application
Set MyOutlook = CreateObject("Outlook.Application")
Set ns = MyOutlook.GetNamespace("MAPI")
Set Folder = ns.GetDefaultFolder(olFolderInbox)
MyOutlook.Explorers.Add Folder
Set rsemail = CurrentDb.OpenRecordset("eMail")
Set MyMail = MyOutlook.CreateItem(olMailItem)
With MarkAsTask = MailItem.SentOnBehalfOfName("Info@somewhere.co.nz")
End With
Do Until rsemail.EOF
MyMail.BCC = MyMail.BCC & rsemail!eMail & ";"
'And on to the next one...
rsemail.MoveNext
Loop
'This gives it a subject
MyMail.Subject = Subjectline$
MyMail.Body = "Hello," & Chr(13) & Chr(13) & "Please find attached your copy of the current news letter." & Chr(13) & Chr(13) & "Thank You from the Team"
MyMail.Display
Set MyMail = Nothing
Set MyOutlook = Nothing
DoCmd.SetWarnings True
rsemail.Close
db.Close
Set db = Nothing
End Sub