问题
I'd like to open outlook via command with parameters and launch macro once is opened...
this code open outlook with parameters
outlook.exe /c ipm.note /m "m@m.m&subject=abc&body=123" /a "f:\attach.txt"
if I add code to launch a macro, outlook won't open and give me an error... what's wrong in this code ?
outlook.exe /c ipm.note /m "m@m.m,&subject=abc&body=123" /a "f:\attach.txt" /autorun mymacro
回答1:
You can't run a macro using a command-line switch. The only relevant command is /altvba, but that's for loading an alternate VBA project file. There's also no option to pass data as a value to be read by a macro if that's your intent. Perhaps an add-in would be best for your solution?
来源:https://stackoverflow.com/questions/34038609/start-outlook-command-line-switches-parameters-and-launch-macro