Forum: สอบถามปัญหา Notes ทางด้านพัฒนาโปรแกรม (Note Client) |
Tags1: | Created on Aug 5, 2011, 5:50 AM by 9notes/9Notes|Topic Responses: 2 |
&action=openDocument&documentId=12E6 |
ผมเข้าใจว่าการเรียก shell เวลาที่มันหา .exe ไม่เจอมันจะขึ้นอันนี้ครับ ต้องลองเช็คข้ามการ shell ในกรณีที่ไม่เจอไฟล์ acrord32.exe ใน path นั้น ๆ ดูครับ โดยใช้คำสั่งนี้ครับ
Function FileExists(sFilePath As String) As Variant
' ==================================================================
' Purpose: To check wheather a specified filename/directory exists
' Parameters:
' sFilePath = The filename/directory to investigate
' Return value:
' True - Indicates that the filename/path exists
' False - Indicates that the filename/path doesn't exist
' ==================================================================
On Error Goto File_Error
FileExists = False
Dim x As Variant
x = Dir$(sFilePath)
If x = "" Then
FileExists = False
Else
FileExists = True
End If
breakout:
Exit Function
File_Error:
FileExists = False
Resume breakout
End Function |
|