wrote a activex dll using object model (mapi)

X

xSMOKEx

ok hmm
i wrote this dll it works local and as windows service
(i got a on error event handle too!)
but for whatever reason it stops

(small pice of code)

On Error GoTo err_mailSend
Set Itm = objOutlook.CreateItem(0)
If Sendstrmailto <> "" Then
With Itm
.To = Sendstrmailto
If Sendsubject <> "" Then
.Subject = Sendsubject
End If
Do While icount <> 0
If attchfile(icount) <> "" Then
.Attachments.Add attchfile(icount)
End If
icount = (icount - 1)
Loop
.SEND
End With

it stops at .SEND
but doesnt jump to err_mailSend

err_mailSend:
If debugmode = True Then
Open "c:\temp\Debug.log" For Append As #1
Write #1, "-------------------------------"
Write #1, "Type: [ERROR]"
Write #1, Date$ & " - " & Time$
Write #1, "ITSendMail()"
Write #1, "Error Number: " & Err.Number & vbCrLf & "Erro
Source: " & Err.Source & vbCrLf & "Error Description: "
Err.Description
Write #1, "-------------------------------"
Close #1
End If

(yes debugmode is on as it writes everything else to c:\temp\Debug.log
but for whatever reason it stops at .SEND whitout printing out a error
..i cant imagine whats the problem as i dont get any error message :(
(the only thing that i know is that the dll stops exactly one lin
before .SEND)
hope someone can help me

(i included in this message a attachment)
thats the hole code i use

+----------------------------------------------------------------
| Attachment filename: itmail_dll.txt
|Download attachment: http://www.outlookforum.com/forums/attachment.php?postid=266950
+----------------------------------------------------------------
 
K

Ken Slovak - [MVP - Outlook]

Outlook code cannot be used in a Windows service. You would have to use CDO
1.21 code or Extended MAPI.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top