lnxxnchzyl 发表于 2009-10-19 09:58:09

使用Sheel()函数在Excel中调用Word并打开一个DOC文档

使用Sheel()函数在Excel中调用Word并打开一个DOC文档
这可是我们经常要用到的哦

Sub OpenDOC()
Dim RetVal
Dim filen As String
filen = InputBox("请输入文件名(含路径和扩展名)")
RetVal = Shell("D:\Programs\Microsoft Office\OFFICE11\WINWORD.EXE " + filen, vbNormalFocus)
Cells(1, 1) = RetVal
End Sub
页: [1]
查看完整版本: 使用Sheel()函数在Excel中调用Word并打开一个DOC文档