Envoi de Mail VBA/ Access 2003 / User defined type not defined
Bonjour à tous,
J'ai récupéré un code afin de pouvoir envoyer des mails via un formulaire access 2003...
Je l'ai transformé pour l'adapter à mon propre formulaire...
Cela fonctionnait très bien avec le formulaire téléchargé sur http://www.blueclaw-db.com/
Mais depuis que j'ai installé le code VBA sur mon formulaire, j'ai toujours le même message: user-defined type not defined!
Quelqu'un peut il m'aider?
Merci à tous.
Voici le code VBA en question:
Code:
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
| Private Sub Command42_Click()
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = Me.ToAll
.Cc = Me.CcAll
.Subject = Me.Subject
.HTMLBody = Me.Message
If Left(Me.Attachement, 1) <> "<" Then
.Attachments.Add (Me.Attachement)
End If
'.DeleteAfterSubmit = True 'This would let Outlook send th note without storing it in your sent bin
.Send
End With
'MsgBox MailOutLook.Body
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
Resume Error_out
Error_out:
End Sub |
:cry: