Pour executer une macro toutes les x minutes ou à tel autre moment avec un VBSCRIPT et le gestionnaire de taches qui va lancer une macro VBA !!!
Dans un fichier que vous appelerez ontime_outlook.vbs collez le code ci-dessous.
'##############DEBUT ############### 'By Oliv 29 juin 2007 'Lance une macro dans OUTLOOK Dim theApp, theNameSpace, theMailItem Set theApp = WScript.CreateObject("Outlook.Application") 'Set theNameSpace = theApp.GetNamespace("MAPI") On error resume next 'on peut afficher par exemple le sujet du mail actif . Set theMailItem = theApp.activeInspector.currentitem Msgbox "Le mail actif est " & theMailItem.subject 'ici on lance une macro du nom de toto dans Outlook. Call theapp.toto set theapp = nothing Set theNameSpace= Nothing Set theMailItem= Nothing '##############FIN##############################"
Dans le gestionnaire de taches de windows ajoutez l'execution du fichier selon la période voulu. dans outlook créez votre macro toto Sub toto() MsgBox "ca marche !!" End Sub
|