Dim ReturnValue, I
ReturnValue = Shell("Calc.EXE", 1)   ' 运行计算器。
AppActivate ReturnValue    
For I = 1 To 100   ' 设置计数循环。
   SendKeys I & "{+}", True   ' 按下按键给计算器
Next I   ' 将所有 I 值相加。
SendKeys "=", True   ' 取得总合。
SendKeys "%{F4}", True   ' 按 ALT+F4 关闭计算器。可以仿照此例发送相应的菜单按键