1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| Dim OutApp As Object
Dim OutMail As Object
Dim Dest As String
Dim sTmp As String, SigString As String
Dim Signature As String
Dim Strbody As String
Dim acReport As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItemFromTemplate("C:\confirmation\accesstheme.oft")
'Set OutMail = OutApp.CreateItem(0)
DoCmd.RefreshRecord
DoCmd.RunCommand acCmdSaveRecord
If IsNull(Me.TITRE_SPECTACLE) Then
' Si la valeur saisie est numérique,
' on affiche donc un message d'avertissement
MsgBox "Il n'y a pas de titre de spectacle !", _
vbExclamation
' Annuler la suite des opérations
Exit Sub
End If
If IsNull(Me.Date) Then
' Si la valeur saisie est numérique,
' on affiche donc un message d'avertissement
MsgBox "Il n'y a pas de date de spectacle !", _
vbExclamation
' Annuler la suite des opérations
Exit Sub
End If
If IsNull(Me.HEURE) Then
' Si la valeur saisie est numérique,
' on affiche donc un message d'avertissement
MsgBox "Il n'y a pas d'heure de spectacle !", _
vbExclamation
' Annuler la suite des opérations
Exit Sub
End If
If IsNull(Me.Email) Then
' Si la valeur saisie est numérique,
' on affiche donc un message d'avertissement
MsgBox "Il n'y a pas d'adresse courriel !", _
vbExclamation
' Annuler la suite des opérations
Exit Sub
End If
DoCmd.OpenReport "CONFIRMATION ZONE 1 PDF", acViewPreview, "", "[ORDRE]=" & Me.ORDRE, acNormal
DoCmd.OutputTo acOutputReport, , "PDF", "C:\confirmation\Confirmation de votre spectacle.pdf"
DoCmd.Close , CONFIRMATION_ZONE_1_PDF
Strbody = "<FONT face=" & Chr(34) & "Segoe UI" & Chr(34) & "size=" & Chr(34) & "3" & Chr(34) & ">" _
& "Bonjour, <br>" _
& "Veuillez trouver en pièce jointe la confirmation pour notre spectacle : " & " <b>" & Me.TITRE_SPECTACLE & " </b>" & " le " & "<b>" & Format(Me.Date, "dddd dd mmmm yyyy") & " </b>" & " à " & "<b>" & Me.HEURE & "</b>" & ".<br>" _
& "Merci de <b>remplir la confirmation</b> et de nous la retourner <b>signée</b> par :<br>" _
& "<br>" _
& "  " & "- Fax : 04 67 83 60 32<br>" _
& "  " & "- Courrier : Compagnie Coline - 2 Place G Brassens - BP 2 - 34590 MARSILLARGUES<br>" _
& "  " & "- Courriel : <a href="mailto:coline.spectacles@free.fr">coline.spectacles@free.fr</a> <br>"
SigString = Environ("appdata") & "\Microsoft\Signatures\access.htm"
If Dir(SigString) <> "" Then
sTmp = Environ("appdata") & "\Microsoft\Signatures\" & Dir(SigString)
Signature = GetBoiler(sTmp)
Else
Signature = ""
End If
With OutMail
.To = Me.ORGANISME & " " & Me.VILLE & " " & Me.Email
.CC = ""
.BCC = ""
.Subject = "Confirmation du spectacle : " & Me.TITRE_SPECTACLE & " le " & Me.Date & " de la Compagnie Coline "
.HTMLBody = .HTMLBody & vbNewLine & Strbody & "<br>" '& Signature
'.HTMLBody = Strbody & "<br>" & Signature
.Attachments.Add "C:\confirmation\Confirmation de votre spectacle.pdf"
.Display
End With |
Partager