Here is what the entire HTML page would look like. You can lovingly lift everything from here and create your own test page.

<%@ LANGUAGE="VBSCRIPT" %>

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>ActiveX Component Check</TITLE>
<%
   Set objBrowserType = Server.CreateObject("MSWC.BrowserType")
   If objBrowserType.vbscript = True And objBrowserType.ActiveXControls Then 
%>
<!-- WARNING - This code requires VBScript 2.0.
     It will always fail to detect the Agent control
     in VbScript 1.x, because CreateObject doesn't work.
-->
<script language="vbscript">
If Not HaveAgent() Then
'Microsoft Agent control was not found.
   location.href="http://www.microsoft.com/workshop/imedia/agent/default.asp"
End If

Function HaveAgent()
   ' This procedure attempts to create an Agent control object.
   ' If it succeeds, it returns True.
   '  This means the control is available on the client.
   ' If it fails, it returns False.
   '  This means the control hasn't been installed on the client.
   ' Note that the name "Agent.Control.1" is specific to version 1
   ' of the Agent control.

   Dim agent
   HaveAgent = False
   On Error Resume Next
   Set agent = CreateObject("Agent.Control.1")
   HaveAgent = IsObject(agent)
End Function
</script>
<%Else%>
   <H2 align=center>This browser doesn't support VBScript or ActiveX controls.
      You should head off to an appropriate page to handle this situation.</H2>
<%End If%>

</HEAD>
<BODY>
<H2 align=center>This user already has the control installed! Woo Who!</H2>
</BODY>
</HTML>

© 1999 Microsoft Corporation. All rights reserved. Terms of use.