BruceBussell
Programmer
The following ShellExecute code won't open Manually Associated files, but it will open files like PDF, DOC, and XLS that have Installed File Associations.
If I manually Associate a text file like SAMPLE.D12 with an editor like TEXTPAD 4.5 (using the Always Open With option), then when I run this code it won't load this Manually Associated file.
How does one get ShellExecute or an equivalent way to Open Manually Associated files that were associated using the Windows Always Open This File With option.
Bruce Bussell
---------------------------------------------------------
VB6 Sample code:
Option Explicit
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 Const SW_SHOWNORMAL = 1
Private mlngHandle As Long
Private Sub Command1_Click()
Dim plngHandle As Long
Call ShellExecute(plngHandle, "open", "c:\test.pdf", 0, 0, SW_SHOWNORMAL)
End Sub
---------------------------------------------------------