VBaProject.OTM opening while sending a mail

  • Thread starter Thread starter mookashi
  • Start date Start date
M

mookashi

hi,

Iam facing a peculiar problem. i dont know whats happening here.
im creating an outlook mail item
after creating the mail i do Item.Display
which displays the inspector with a Standard Send Toolbar

however when i click on Send VBaProject.OTM opens and a portion of cod
where im declaring the CDO object is highlighted
e.g Public objCDO as MAPI.Session

however the mail is sent to the outbox but i dont know why this projec
is opening in between. what could be the problem. it has something t
do with the CDO thing im using i cant figure out whats wrong.

So right now im doing a workaround wherein inside th
Application_ItemSend event im saying Cancel=True and manually movin
the mail item to the Outbox. However i dont think this is correc
appraoch.

Someone please help!!

thank
 
You are seeing the Debug function of Outlook VBA.

The VBAProject.OTM is opening because there is ar error in
your code. The error is in the line that's highlighted.

Without seeing your code, it's hard to know what the
problem is, but try creating the CDO session like this:

Dim objSession As Object
Dim strVersion As String
Set objSession = CreateObject("MAPI.Session")

' Logon using an existing MAPI session
objSession.Logon "", "", False, False, 0


If that doesn't help, you'll have to post your code, at
least up to the problem line.


-Andrew Cushen
============================================
 
Back
Top