Office中国论坛/Access中国论坛

标题: 关于shell函数打不开文件的问题 [打印本页]

作者: sisound    时间: 2006-12-8 00:13
标题: 关于shell函数打不开文件的问题
大家请看附件

我用shell函数无法打开D:\a.txt

但是每次都提示"无效的过程"

帮忙看看,谢谢[attach]21990[/attach]

作者: crg770502    时间: 2006-12-8 00:36
shell调来执行外部的程序,比如可执行文件。

用代码打开指定路径的文件

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long




Private Sub Command0_Click()

    ShellExecute 0, "Open", "D:\a.txt", "", "", 5
End Sub


[此贴子已经被作者于2006-12-7 16:36:58编辑过]


作者: sisound    时间: 2006-12-8 17:07
谢谢你

我知道怎么解决了






欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3