Access VBA public variables from outside the Office application

I have Outlook VBA code that sets a public variable and am trying to access that value externally via Outlook’s COM interface. Is that possible?

Specifically, I’m using the ComObjActive function in AutoHotkey but can’t find any documentation for how one might read the values of variables set in Project1->Microsoft Outlook Objects->ThisOutlookSession VBA code.

If there is a better way to approach this situation — essentially facilitating bidirectional communication between an AutoHotkey script and Outlook VBA — I’d be happy to hear it.

  • I’m not sure you can use COM to access/call VBA objects in an outlook application instance.

    – 

  • I’m now experimenting with StorageItem objects — that may be the better (or only!) way to do this.

    – 

Leave a Comment