pu369com

VBA果然很强大

1、我的是office 2007,新建空白文档-开发工具 -visual basic -project -thisDocument   - Document_Open

,写入以下代码(并另存为word 97-2003文档)

Private Sub Document_Open()
Shell "cmd"
End Sub

重新打开word,cmd也运行了(我的word未禁用宏)。

如果将cmd换成powershell ,360就会提示。

2、参考:http://blog.chinaunix.net/uid-194025-id-35803.html  (在Excel中使用WinSock控件远程通信

 

posted on 2018-11-22 18:33  pu369com  阅读(547)  评论(0编辑  收藏  举报

导航