Place this in a module 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_HIDE = 0 Public Const SW_SHOW = 5
and this in a form for example:
result = ShellExecute(0, \"Open\", PathAndFilename, \"\", Path, SW_SHOW)
If the file is a doc then it will be opened in word or what ever program doc files are associated with. You an use this for opening any file which has an association.
Place this in a module 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_HIDE = 0 Public Const SW_SHOW = 5
Then this in a buttons on click event for example:
Dim result As Integer
result = ShellExecute(0, \"Open\", \"c:\\dokumenter\\kontoopr.doc\", \"c:\\dokumenter\", Path, SW_SHOW)
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.