E
eugenalbiker
hello everybody,
i have a problem with ms-access when creating a outlook mail vom access
vba code.
Everything is ok, (creating a email, add an attachment and a
recipient).
but when i want to trigger the "myOlApp_ItemSend" the event i only
triggered in my code when the vba-modul use the command ".send".
NOT when the user CLICK send in the email....
here is my code:
----------------------------
' my Class Klasse1
Public WithEvents myOlApp As Outlook.Application
Public Sub myOlApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
MsgBox ("Only test")
End Sub
--------------------------
Dim loOutlook As New Klasse1 'Outlook
Dim loMail As Outlook.MailItem
On Error Resume Next
Set loOutlook.myOlApp = CreateObject("Outlook.Application")
On Error GoTo 0
Set loMail = loOutlook.myOlApp.CreateItem(olMailItem)
' Empfänger eintragen
loMail.To = "(e-mail address removed)"
loMail.Subject = lvSubject
' EMail anzeigen
loMail.Display
' when I use this send command the event "myOlApp_ItemSend" is triggert
ok. But when I delete this and the USER click the "send" button , the
event "myOlApp_ItemSend" is NOT triggered
' lomail.send
-----------------------------------
Any ideas????
greenting
Eugen
i have a problem with ms-access when creating a outlook mail vom access
vba code.
Everything is ok, (creating a email, add an attachment and a
recipient).
but when i want to trigger the "myOlApp_ItemSend" the event i only
triggered in my code when the vba-modul use the command ".send".
NOT when the user CLICK send in the email....
here is my code:
----------------------------
' my Class Klasse1
Public WithEvents myOlApp As Outlook.Application
Public Sub myOlApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
MsgBox ("Only test")
End Sub
--------------------------
Dim loOutlook As New Klasse1 'Outlook
Dim loMail As Outlook.MailItem
On Error Resume Next
Set loOutlook.myOlApp = CreateObject("Outlook.Application")
On Error GoTo 0
Set loMail = loOutlook.myOlApp.CreateItem(olMailItem)
' Empfänger eintragen
loMail.To = "(e-mail address removed)"
loMail.Subject = lvSubject
' EMail anzeigen
loMail.Display
' when I use this send command the event "myOlApp_ItemSend" is triggert
ok. But when I delete this and the USER click the "send" button , the
event "myOlApp_ItemSend" is NOT triggered
' lomail.send
-----------------------------------
Any ideas????
greenting
Eugen