I have a links program that has a ton of links on it. The idea is to click a link and have it open that page in the default browser. It should cannibalize the browser window if one is already open. So far so good; this works fine:The problem is that this opens a new tab in tabbed browsers. It will quickly become cumbersome to close all those open tabs, so how can I cannibalize an existing tab as well as an existing browser window?Code:Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long ' Launch default browser Public Sub OpenURL(ByVal URL As String) ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus End Sub




Reply With Quote