Option Explicit '$TPInclude "modMenu" Const READYSTATE_COMPLETE = 4 '******************************************************************************* '* '*
'* Function GetBrowser(Optional sStartPage As String) As Object '* '* '*
'* This function is to instantiate and return an instance of an internet explorer application. '* '* '*
'* '* '*
'* '* '*
'* Optional sStartPage This string if provided will set the internet explorer browser to this page. '* '* '* '* Object instantiated to an internet explorer application instance '* '* '* <MODIFICATION HISTORY> '* 11-03-2003 (Maxine McNaughton) '* '* '******************************************************************************* Function GetBrowser(Optional sStartPage As String) As Object Dim oIE As Object Set oIE = CreateObject("InternetExplorer.Application") If oIE Is Nothing Then LogEntry "Could not invoke Internet Explorer Object" Exit Function Else LogEntry "Invoked Internet Explorer Application successfully" End If 'Show the browser window and navigate to the start page if provided oIE.Visible = True If IsMissing(sStartPage) = False Then oIE.Navigate (sStartPage) LogEntry "Navigated to " & sStartPage End If While oIE.ReadyState <> READYSTATE_COMPLETE
Wend Pause 2 Set GetBrowser = oIE Set oIE = Nothing Exit Function End Function '******************************************************************************* '* '* '* Function LoadPage(oIE As Object, sPage As String) As Object '* '* '* '* This function is to navigate to a page. '* '* '* '* '* '* '* '* '* '* oIE This is an instantiate instance of internet explorer application '* sPage The page to set the internet explorer browser to. '* '* '* '* Object instantiated to an internet explorer application instance loaded with the page requested if '* successful. '* '* '* <MODIFICATION HISTORY> '* 11-03-2003 (Maxine McNaughton) '* '* '******************************************************************************* Function LoadPage(oIE As Object, sPage As String) As Object If oIE Is Nothing Then GetBrowser End If oIE.Navigate (sPage) LogEntry "Navigated to " & sPage While oIE.ReadyState <> READYSTATE_COMPLETE Wend Pause 2 Set LoadPage = oIE Exit Function
End Function