我想让程序自动调用与PDF文件相关联的软件打开PDF文件,从网上查到了一段代码:
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 LongPrivate Sub Command1_Click()
ShellExecute Me.hwnd, "open", "d:\mc\123.pdf", vbNullString, vbNullString, 3
End Sub
但是执行的时候却提示编译错误 ,在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 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 LongPrivate Sub Command1_Click()
ShellExecute Me.hwnd, "open", "d:\mc\123.pdf", vbNullString, vbNullString, 3
End Sub
但是执行的时候却提示编译错误 ,在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
处出错。
哪位大哥帮忙解决一下呀?
解决方案 »
- 使用WinAPI函数,输入进程名,获得进程ID
- 如何使用VC写的DLL函数?
- 请问如何通过修改注册表实现类似winrar的“压缩为*.rar”系统菜单功能?
- 如何将ACTIVEREPORT中某列合计数值传给另外一个文本框
- 请问ADODC中FIND怎样查同时符合两个条件的记录?
- 急急急!!!!将Excel的图表的属性读到vb中
- 请问我想该该win98和w2k的启动顺序,该如何办?
- 请问怎么样让做出来的东东,在最前面呀?
- 用VB的应用程序向导生成的程序也会出错吗,各位帮忙看看!!?
- 在VB6中,报表如何调用recordset
- datagrid 表格显示问题??急!1
- 为什么下列SQL语句在VB中无法运行呢?
编译错误:
在End Sub、End Function 或End属性后面只能出现注释