If [A5] <> M1 Then
M1 = [A5]
SendMail1
End If
If [L5] <> M2 Then
M2 = [L5]
SendMail2
End If
If [W5] <> M3 Then
M3 = [W5]
SendMail3
End If
If [AH5] <> M4 Then
M4 = [AH5]
SendMail4
End If
If [AS5] <> M5 Then
M5 = [AS5]
SendMail5
End If
End Sub[/QUOTE]
[QUOTE]Sub SendMail1()
Dim ol As Object
Dim olmail As Object
Dim CurrFile As Object
Set ol = CreateObject("Outlook.Application")
Set olmail = ol.CreateItem(0)
With olmail
.To = "timeislimite@hotmail.com"
.Subject = [A5]
.Body = ": " & [A7] & " : " & [B7]
' .Attachments.Add "c:\data\essai.doc"
.Send
'Debug.Print PlaySoundFileA("C:\Windows\Media\tada.wav")
Dim Msg, Style, Title, Response
Call Sounds
Msg = ": " & [A7] & " : " & [B7]
Style = vbYesNoCancel + vbQuestion + vbDefaultButton1
Title = [A5]
Response = MsgBox(Msg, Style, Title)
End With
End Sub
Sub SendMail2()
Dim ol As Object
Dim olmail As Object
Dim CurrFile As Object
Set ol = CreateObject("Outlook.Application")
Set olmail = ol.CreateItem(0)
With olmail
.To = ""
.Subject = [L5]
.Body = ": " & [L7] & " : " & [M74]
' .Attachments.Add "c:\data\essai.doc"
.Send
Call Sounds
Dim Msg, Style, Title, Response
Msg = ": " & [L7] & " : " & [M7]
Style = vbYesNoCancel + vbQuestion + vbDefaultButton1
Title = [L5]
Response = MsgBox(Msg, Style, Title)
End With
End Sub
Sub SendMail3()
Dim ol As Object
Dim olmail As Object
Dim CurrFile As Object
Set ol = CreateObject("Outlook.Application")
Set olmail = ol.CreateItem(0)
With olmail
.To = ""
.Subject = [W5]
.Body = ": " & [W7] & " : " & [X7]
' .Attachments.Add "c:\data\essai.doc"
.Send
Call Sounds
Dim Msg, Style, Title, Response
Msg = ": " & [W7] & " : " & [X7]
Style = vbYesNoCancel + vbQuestion + vbDefaultButton1
Title = [W5]
Response = MsgBox(Msg, Style, Title)
End With
End Sub
Sub SendMail4()
Dim ol As Object
Dim olmail As Object
Dim CurrFile As Object
Set ol = CreateObject("Outlook.Application")
Set olmail = ol.CreateItem(0)
With olmail
.To = ""
.Subject = [AH5]
.Body = ": " & [AH7] & " : " & [AI7]
' .Attachments.Add "c:\data\essai.doc"
.Send
Call Sounds
Dim Msg, Style, Title, Response
Msg = ": " & [AH7] & " : " & [AI7]
Style = vbYesNoCancel + vbQuestion + vbDefaultButton1
Title = [RD5]
Response = MsgBox(Msg, Style, Title)
End With
End Sub
Sub SendMail5()
Dim ol As Object
Dim olmail As Object
Dim CurrFile As Object
Set ol = CreateObject("Outlook.Application")
Set olmail = ol.CreateItem(0)
With olmail
.To = ""
.Subject = [AS5]
.Body = ": " & [AS7] & " : " & [AT7]
' .Attachments.Add "c:\data\essai.doc"
.Send
Call Sounds
Dim Msg, Style, Title, Response
Msg = ": " & [AS7] & " : " & [AT7]
Style = vbYesNoCancel + vbQuestion + vbDefaultButton1
Title = [RP5]
Response = MsgBox(Msg, Style, Title)
End With
End Sub