按照文件默认格式打开已经可以了,但是要如何判断文件不存在?
Private Sub Command246_Click()
Dim lngRe As Long
Dim tempth As String
tempth = d:\
lngRe = ShellExecute(Me.hwnd, "open", tempth & Me.zuhe1.Value & "报告书.pdf", vbNullString, vbNullString, SW_SHOWNORMAL)
If lngRe = SE_ERR_NOASSOC Then
Shell "rundll32 shell32,OpenAs_RunDLL " & tempth & Me.zuhe1.Value & "报告书.pdf", vbNormalFocus
End If
If Dir(lngRe) <> 0 Then
MsgBox "文件不存在!"
End If