I'm trying to make a basic macro in Outlook that will launch an AHK script when I click it. Making the button is easy, the script is escaping me though.
Googling suggests I should do something like
Code: Select all
Sub RunScript()
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.CurrentDirectory = "C:\folder\subfolder\"
WshShell.Run "ahkScript.ahk"
End Sub
But that's not working (no errors when I try to just run it from Outlook, gives an Object missing error when I try to run it in Microsoft VBA).
Anyone got a minute and any skill with VBA to help me out?
I'm trying to make a basic macro in Outlook that will launch an AHK script when I click it. Making the button is easy, the script is escaping me though.
Googling suggests I should do something like
[code]
Sub RunScript()
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.CurrentDirectory = "C:\folder\subfolder\"
WshShell.Run "ahkScript.ahk"
End Sub
[/code]
But that's not working (no errors when I try to just run it from Outlook, gives an Object missing error when I try to run it in Microsoft VBA).
Anyone got a minute and any skill with VBA to help me out?