Trigger Application_ItemSend event when sending using Access macro

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.
Similar threads
Thread starter Title Forum Replies Date
M Subject Line Automation - Trigger Script Delayed Outlook VBA and Custom Forms 2
T Sending One Email to Trigger Another Being Sent Using an Email within the 1st? Using Outlook 0
Z Trigger macro to run after a new mail is received in Outlook? Using Outlook 3
D Trigger macro to run when selected email is opened Using Outlook 3
J dragging an calendar item to deleted folder does not trigger ItemRemove event Outlook VBA and Custom Forms 1
bmtjedi Set objApp = Application Not Working in O365-32bit Using Outlook 1
avant-guvnor Outlook.Application now produces error Outlook VBA and Custom Forms 5
C Custom Application Form send Email to Another User Using Outlook 1
N Select Existing BCM Business Contact in C# application Using Outlook 0
S Using "start application" rule action Using Outlook 2
smokiibear windows security mail application not accepting username and password Using Outlook 0
Y VBA - Application Filedialog Hidden Behind Outlook Using Outlook 0
T Synchronize outlook appointments through web application. Using Outlook 1
O Outlook 2010 Stops Working When Accounting Application Tries To Send eMail Using Outlook 4
C MAPI to access a 64 bit Outlook from a 32 bit application; or access via ODBC Using Outlook 0
K Handling application.quit event Outlook VBA and Custom Forms 8
A turn Outlook into a Drag-and-drop application Outlook Wishlist 2
M VSTO C#: How do I declare an application scope variable? Outlook VBA and Custom Forms 2
E Turn application visibility off Outlook VBA and Custom Forms 2
T Run application from cmd button Outlook VBA and Custom Forms 5
D Outlook 2007 Will Not Send Mail From C# Application Outlook VBA and Custom Forms 7
P Supporting threads in Outlook VBA application Outlook VBA and Custom Forms 1
R vba instantiated internetExplorer.application differs from user la Outlook VBA and Custom Forms 1
K How to disconnect Application.COMAddIns.Item().Object? Outlook VBA and Custom Forms 4
D outlook.exe application error - breakpoint has been reached. fix? BCM (Business Contact Manager) 1
P Drag and Drop mails from Outlook to Clarion6 Application Outlook VBA and Custom Forms 5
J Office application does not match advisory. Why? BCM (Business Contact Manager) 3
D Application.ActiveInspector() is Null on Ribbon Load Outlook VBA and Custom Forms 1
D Application.ActiveInspector().CurrentItem Returns Wrong(Old) Value Outlook VBA and Custom Forms 3
L RE: BCM Office Application Issue BCM (Business Contact Manager) 1
R Can calendar be displayed in another Office application? Outlook VBA and Custom Forms 1
E When more than "ItemSend" is needed Using Outlook 5
B Looking for email address under ItemSend event Outlook VBA and Custom Forms 6
E Properties added to MailItem in ItemSend event visible to recipien Outlook VBA and Custom Forms 1
P ItemSend event not firing Outlook VBA and Custom Forms 2
T Hooking up the ItemSend Event... Outlook VBA and Custom Forms 1

Similar threads

Top