Bonjour,

J'essaie actuellement d'appeler une macro dans mon Outlook 2003, j'ai installé pywin32 et j'ai fouillé longuement sur internet mais je ne trouve pas de solution qui fonctionne.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
class OutL:
    def __init__(self):
    oOutlook = win32.gencache.EnsureDispatch("Outlook.Application")
    oOutlook.run('maFonction')
J'ai aussi essayé

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 
class OutL:
    def __init__(self):
    oOutlook = win32.gencache.EnsureDispatch("Outlook.Application")
    o = oOutlook.Application
    o.run('maFonction')
J'ai toujours le même problème

AttributeError: '<win32com.gen_py.Microsoft Outlook 11.0 Object Library._Application instance at 0x21542128>' object has no attribute 'run'

Auriez-vous une idée pour appeler directement une macro VBA via Python ?

Merci