Scheduling an Outlook Macro

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?
 
G

Guest

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.
 
G

Guest

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/
 
G

Guest

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/
 
G

Guest

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.
 
Joined
Apr 3, 2009
Messages
1
Reaction score
0
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 ??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top