Public 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
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWDEFAULT = 10
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOWNORMAL = 1
Function StartOfFile(strNameFile As String)
Dim intResult As Integer
intResult = ShellExecute(Application.hWndAccessApp, "open", strNameFile, 0, 0, SW_SHOWNORMAL)
If intResult = 31 Then
MsgBox "Незарегестрированный тип файла"
End If
End Function
Вызывается так
StartOfFile("C:\1_Текущее\proba.rtf")
|