Trigger Application_ItemSend event when sending using Access macro

  • Thread starter R3JhbnQgSQ
  • Start date Views 3,045
Status
Not open for further replies.
R

R3JhbnQgSQ

Hi there - I have written a simple bit of code in Outlook's ItemSend event

that works perfectly when sending directly from Outlook. However, I would

really like for it to fire when Access sends an email using the SendObject

function in a macro. It works fine if I have the email open before sending

(i.e. I have to click the send button), but when Access sends without opening

the object, the event does not fire. Any ideas? Wasn't sure whether to post

in Access or Outlook, but thought I'd start here first.

Thanks all!!
 
K

Ken Slovak - [MVP - Outlook]

SendObject uses Simple MAPI and that produces an Inspector that's in the

Inspectors collection but doesn't fire NewInspector, so your code knows

nothing about it. Therefore you can't handle Item.Send since you have no

reference to Item. Use the Outlook object model instead of SendObject.

"Grant I" <GrantI> wrote in message

news:8C8C9C91-9E94-457D-A2B0-1E5742AA10A9@microsoft.com...
> Hi there - I have written a simple bit of code in Outlook's ItemSend event
> that works perfectly when sending directly from Outlook. However, I would
> really like for it to fire when Access sends an email using the SendObject
> function in a macro. It works fine if I have the email open before
> sending
> (i.e. I have to click the send button), but when Access sends without
> opening
> the object, the event does not fire. Any ideas? Wasn't sure whether to
> post
> in Access or Outlook, but thought I'd start here first.

> Thanks all!!
 
R

R3JhbnQgSQ

Re: Trigger Application_ItemSend event when sending using Access m

Thanks Ken, that's what I was afraid of. Appreciate the reply & explanation!!
wrote:


> SendObject uses Simple MAPI and that produces an Inspector that's in the
> Inspectors collection but doesn't fire NewInspector, so your code knows
> nothing about it. Therefore you can't handle Item.Send since you have no
> reference to Item. Use the Outlook object model instead of SendObject.

> >

>

> "Grant I" <GrantI> wrote in message
> news:8C8C9C91-9E94-457D-A2B0-1E5742AA10A9@microsoft.com...
> > Hi there - I have written a simple bit of code in Outlook's ItemSend event
> > that works perfectly when sending directly from Outlook. However, I would
> > really like for it to fire when Access sends an email using the SendObject
> > function in a macro. It works fine if I have the email open before
> > sending
> > (i.e. I have to click the send button), but when Access sends without
> > opening
> > the object, the event does not fire. Any ideas? Wasn't sure whether to
> > post
> > in Access or Outlook, but thought I'd start here first.
> > Thanks all!!


>
 
Status
Not open for further replies.
Top