0

I want to send email every time a recurring reminder fires.

I am using VBA code from https://www.slipstick.com/developer/send-email-outlook-reminders-fires/

The only change I made is to set the .BCC to my email address (not shown in this post).

I do not know how to tell whether the code executes, or whether it executes but does not do what I want. Is there a way to know whether it executes?


ADDITIONAL DESCRIPTION OF PROBLEM

I use alt-F11 to get to my VBA code. It does not show up when I try to access it as a macro.
My code used to run when a reminder fired.
I tried multiple ways to get my code to run.

I wanted to attach screen shots but I could not find out how.

I have my VBA code in both of these places:
Project 1 (VbaProject.OTM) - Microsoft Outlook Objects – ThisOutlookSession
Project 1 (VbaProject.OTM) – Modules – Module1

File > Options > Addins shows the “Microsoft VBA for Outlook Addin” in “Active Application Add-Ins”.
However, when I go to Developer tab > Com Add-Ins “Microsoft VBA for Outlook Addin” is not listed.
On that screen, I clicked Add and chose OUTLVBA.DLL from this folder: C:\Program Files (x86)\Microsoft Office\root\Office16\ADDINS To try to add it. I got this error message:

“ ’C:\Program Files (x86)\Microsoft Office\root\Office16\ADDINS\OUTLVBA.DLL’ is not a valid Office Add-in.”

“Microsoft VBA for Outlook Addin” is not listed in Developer tab > Disabled Items

I have gone to Developer tab > Macro Security. I tried the fourth option (Enable all macros), but it still did not work, so I set it back to option 2 (Notifications for digitally signed…”. That is what I had before when the code used to run.

When I go to Developer tab > Macros > Macros and create a small macro and then click Run, I get this message:

“The macros in this project are disabled. Please refer to the online help or documentation of the host application to determine how to enable macros.”

I have both clicked Help and googled but not found out how to enable macros.

Private Sub Application_Reminder(ByVal Item As Object)

Dim objMsg As MailItem
  
'IPM.TaskItem to watch for Task Reminders
If Item.MessageClass <> "IPM.Appointment" Then
    Exit Sub
End If

If Item.Categories <> "Send Mail" Then
    Exit Sub
End If

Set objMsg = Application.CreateItem(olMailItem)
With objMsg
    .To = Item.Location
    .BCC = "xxx@centurylink.net"
    .Subject = Item.Subject
    .Body = Item.Body
    .Send
End With
Set objMsg = Nothing
End Sub
Community
  • 1
  • 1
  • This is on Windows 10 on an HP Geforce GTX laptop. – Lars - Washington Jan 09 '22 at 01:39
  • I do not know whether this is related to what I had been doing. When I restarted Outlook 2016 after a number of added/changed macros, “msgboxes” displayed to “Disable application add-in”, which I did on each one. All of these .dll’s were in: C:\Program Files (x86)\Microsoft Office\root\Office16\ (I did not note what the first one was.) ONBttnOL.dll SOCIALCONNECTOR.DLL UCAddin.dll \ADDINS\UmOutlookAddin.dll \ADDINS\OUTLVBA.DLL With the last one disabled, I could not edit VBA code. Therefore, I enabled it and also clicked “enabled macros” on the next display. – Lars - Washington Jan 09 '22 at 02:11
  • The `Microsoft VBA for Outlook Add-in` should be enabled if you want to execute your VBA macros in Outlook. – Eugene Astafiev Jan 09 '22 at 09:04
  • This may be useful [How to fix missing add-in in Outlook 2019, 2016, 2013, 2010 or Office 365](https://www.techhit.com/how-to/fix-missing-add-in-outlook-2016-2013-2010/) – niton Jan 26 '22 at 14:35
  • niton: I had already tried that, as shown in what I have added as an Edit of the question. – Lars - Washington Jan 27 '22 at 22:56
  • I all else fails, try the "reboot" option. https://stackoverflow.com/a/11863497/1571407 First save a copy of VbaProject.OTM https://stackoverflow.com/a/11863497/1571407 – niton Jan 28 '22 at 01:14

1 Answers1

0
  1. Check if the message is in the Sent Items folder.
  2. Add a line like MsgBox "Test" to the beginning of your Application_Reminder event handler.
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • I have found out 2 things: I can put MsgBoxes into the VBA code (thanks Dmitry) and I had the wrong category name: "Send Mail" instead of "Send Email". – Lars - Washington Jan 09 '22 at 06:36
  • However, I still do not understand the matter of “Disable application add-in” in my second comment. Anyone have ideas on that? – Lars - Washington Jan 09 '22 at 06:38
  • It seems add-ins were disabled for security concerns, see [ADDINS: OUTLVBA.DLL FILE IN LOOP](https://answers.microsoft.com/en-us/outlook_com/forum/all/addins-outlvbadll-file-in-loop/80657594-1497-412a-9579-cb328f368729) for more information. – Eugene Astafiev Jan 09 '22 at 09:06
  • I am still having same the problem of the event Application_Reminder not executing when a reminder fires. I have done much googling and not found a way to make it work. – Lars - Washington Jan 26 '22 at 01:56
  • Do you see that event fire in OutlookSpy (click Application button, go to the Events tab, look at the log at the bottom of the tab)? – Dmitry Streblechenko Jan 26 '22 at 02:52
  • Reminder (IDispatch) NewMailEx (00000000BCBC27AA1C47E049A5DC65F37FE29BF524A33500) NewMail () – Lars - Washington Jan 26 '22 at 05:56
  • Do you see the Reminder event fire when Outlook pops up the reminder dialog? – Dmitry Streblechenko Jan 26 '22 at 06:57