L
Liam.M
Hey guys.....
Okay I need to some help with code please....I need to query my
database....look for the "DueDate" Field, if it is within the next two
months....then I need it to Run a Command I have already written which
is as follows :
Private Sub Command38_Click()
Dim strTo As String
Dim strsubject As String
Dim varbody As Variant
Dim strattachment1 As String
Dim strattachment2 As String
strTo = Me!EmailAddress
strsubject = "subject"
varbody = "Attached please find your confirmation"
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")
Dim olNs As Outlook.NameSpace
Set olNs = olApp.GetNamespace("MAPI")
olNs.Logon
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
olMail.To = strTo
olMail.Subject = strsubject
olMail.Body = varbody
olMail.Send
Set olNs = Nothing
Set olMail = Nothing
Set olApp = Nothing
End Sub
How would I go about this>?
Regards,
Liam
Okay I need to some help with code please....I need to query my
database....look for the "DueDate" Field, if it is within the next two
months....then I need it to Run a Command I have already written which
is as follows :
Private Sub Command38_Click()
Dim strTo As String
Dim strsubject As String
Dim varbody As Variant
Dim strattachment1 As String
Dim strattachment2 As String
strTo = Me!EmailAddress
strsubject = "subject"
varbody = "Attached please find your confirmation"
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")
Dim olNs As Outlook.NameSpace
Set olNs = olApp.GetNamespace("MAPI")
olNs.Logon
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
olMail.To = strTo
olMail.Subject = strsubject
olMail.Body = varbody
olMail.Send
Set olNs = Nothing
Set olMail = Nothing
Set olApp = Nothing
End Sub
How would I go about this>?
Regards,
Liam