Asked by:
application_startup doesn't excute

-
When you create an email from another app like SentTo from Excel or email button in Access as well as 'mailto:' links from browser, the mail item is displayed and outlook.exe runs, but my application_startup() doesn't fire. Is there way to get the startup code to fire in this case?
The problem is, I need to force a send/receive in this case before outlook exits, otherwise items sit in outbox. I can force this with Application_Send() like below, but it seems the code in ThisOutlookSession is not loading when outlook mail item is displayed.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) If vbYes = MsgBox("Send Now?", vbYesNo, "Send Immediately?") Then Session.SendAndReceive (True) End Sub Sub STARTUP() Application_Startup End Sub Sub Application_Startup() MsgBox "Startup" End Sub
Thanks,
Josh
Question
All replies
-
-
Thanks Ken. Before I look into add-in may I clarify?...
Will a properly configured add-in automatically load when Outlook is started using Simple MAPI so that users can continue to use simple MAPI? Or are you saying I need to have folks use OL code to create mail items instead of use the Simple MAPI OS default mail app?
Do you have a quick link to such a modal inspector sample add-in?
Thanks,
Josh
- Edited by joshbooker Wednesday, July 24, 2013 6:48 PM spell
-
Outlook has never supported any addins to run against Simple MAPI.
You have to specially code for it and handle the problems that come up, such as modal Inspector windows that don't close when you automate them, and an Inspector that is in the Inspectors collection but never fires the NewInspector() event.
There's nothing documented for that, as it's not supported. Some people have worked out methods of handling all or most of the problems, but again nothing's documented for the most part.
Ken Slovak MVP - Outlook
-
-