Outlook 97 MailItem.Send event

J

Julieta Prandi

Hi,
I have 2 questions for you guys that know everything about Outlook:
I've connected the Send event in the MailItem object and I've found that it
has no parameters so I wonder 2 things:
- Can the send process be canceled?
- Is the typelibrary compatible?

Thank you a lot!
(-- Julieta --)
 
D

Dmitry Streblechenko

There is no Send event in Outlook 97. There is a MailItem.Send method of
course.
Processing the OnSubmit/OnWrite/OnWriteComplete/OnSubmitComplete sequence of
events from an ECE is the only way to get a notification when a message is
sent.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
J

Julieta Prandi

Hi Dmitry,
I really glad to receive always your responses.
The MailItem.Send event do exist, I connected and it works in my Outlook 97
but it doesn't have the output parameter to cancel it.
I didn't understand your answer about ECE, what it ECE and I don't know
where I can find the OnSubmit/... events that you've told me.
Please, Dmitry save me again!

(--Julieta--)
 
D

Dmitry Streblechenko

Hmmm... You are right about the Send event. Why doesn't OutlookSpy show that
dispinterface for the mail items in Outlook 97?
ECE is an Exchange Client Extension, that's ewhat people had to do before
COM addins. ECE API still works fine in all versions of Outlook.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
D

Dmitry Streblechenko

Oh, I see what the problem is: ItemEvents is defined both as a regular
interface (?) and as a dispinterface (that's what it need to be). This was
fixed in the Outlook 98 type library.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
J

Jyothi

Hi All,

I am trying to send an email from MSACCESS (VBA) . But the code i
hanging. Please tell me what is wrong! in my code.

Dim strErrMsg As String 'For Error Handling
Dim olApp As New Outlook.Application
Dim olNameSpace As Outlook.NameSpace
Dim olMail As Outlook.MailItem
Dim oleGrf As Object
Dim strFileName As String

Set olNameSpace = olApp.GetNamespace("MAPI")
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = "(e-mail address removed)"
.Subject = "Test Mail"
'.Attachments.Add strFileName
.ReadReceiptRequested = False
.Send
End With

Thanks in advanc
 
D

Dmitry Streblechenko

1. Please do not hijack existing (unrelated) threads. Create your own.
2. Which line exactly hangs?
3. Did you try to add a call to olNameSpace.Logon immediately after
olApp.GetNamespace?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
J

Jyothi

Hi Dmitry Streblechenko,

Thanks for reply. I am sorry. I am a new user of this forum. I didn'
know how to create a thread. I saw outlook related topic so I posted m
question.

My code hangs at ".send" statement. And I have not used .Logon metho
of "NameSpace". Please help me. I have outlook installed in my PC an
always connected to Internet (proxy server).

Thanks and regards
Jyoth
 
J

Jyothi

Hi Dmitry Streblechenko,

Following is my code.

Dim olApp As New Outlook.Application
Dim olNameSpace As Outlook.NameSpace
Dim olMail As Outlook.MailItem

Set olNameSpace = olApp.GetNamespace("MAPI")
Set olMail = olApp.CreateItem(olMailItem)
With olMail
. To = "(e-mail address removed)"
. Subject = "Test Mail"
. Send
End With

Thanks and regards
Jyoth
 
D

Dmitry Streblechenko

See the change below (olNameSpace.Logon).
Where is the code running? Are you sure you are not getting the security
prompt in the Send method (which is blocked)?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
J

Jyothi

Hi Dmitry Streblechenko,

I am running the code in VB module of MSACCESS. And I am not gettin
any prompt. And I am not able to logon also.



Thank
 
D

Dmitry Streblechenko

What do you mean by "And I am not able to logon also"? Do you get an error
when calling Namespace.Logon?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
J

Jyothi

Hi Dmitry,

Now I am not getting any error at ".Logon" statement but it hangs up a
".send" line.
My system is not directly connected to Internet but proxy and als
remote SMTP server (my system is in LAN). One more thing is Mcafe
Antivirus is running in my system. And I have enabled port 25 which wa
blocked earlier by this antivirus software. But still it is not running
Please help me.


Thanks
Jyoth
 
D

Dmitry Streblechenko

I don't know, sorry. Does it go out Ok if you call MailItem.Display instead
of MailItem.Send and click on the Send button explicitly?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

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