Scheduling an Outlook Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Outlook macro that searches my inbox for .txt attachments and
copies the attachment to my hard drive. Is there a way to automate this
macro to run automatically everyday. I have tried to use scheduler but all
you can do with that is open Outlook itself. Or, does anyone have an
executable already that does this?
 
You cannot automate Outlook from any code tied to the Scheduler. The easiest
way to schedule a macro is to associate it with a Task that has a reminder
set. Then use the Reminder event to look for that Task and fire the macro if
it matches.
 
Can you give me some hints how to do that

Eric Legault said:
You cannot automate Outlook from any code tied to the Scheduler. The easiest
way to schedule a macro is to associate it with a Task that has a reminder
set. Then use the Reminder event to look for that Task and fire the macro if
it matches.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 
Sure, it's actually pretty simple. To illustrate, create a Task with "My
Scheduled Reminder" as the subject and set a reminder. Then paste this code
into your ThisOutlookSession module. It'll run just before the reminder is
displayed.

Private Sub Application_Reminder(ByVal Item As Object)
If Item.Subject = "My Scheduled Reminder" Then
'Run my procedure here
MsgBox "I'm calling a macro!"
End If
End Sub

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 
Thanks. I actually stuck my code in startup then will use Scheduler to Open
Outlook

One more question, please.

Is there any code that I could use to close Outlook when my macro is finished.
I could put the code in Outlook or an Access Database that will run after my
Outlook operations.
 
No Response from Outlook

I've tried placing a MsgBox in Application_Startup and Application_Reminder events of the ThisOutlookSession module in the default project Project1 (VbaProject.OTM) with no results ?? Is there some other configuration I'm missing ??
 
Back
Top