The Certificate Enrollment Control Instantiated in VBScript
The following Visual Basic Scripting Edition (VBScript) example uses the OBJECT tag to create an instance of the Certificate Enrollment Control object. The object is freed from memory when it goes out of scope.
<HTML>
<HEAD>
<TITLE>VBScript Certificate Enrollment Control Sample
</TITLE>
<OBJECT classid="clsid:127698E4-E730-4E5C-A2b1-21490A70C8A1"
codebase="xenroll.dll"
id=Enroll >
</OBJECT>
<BR>
Certificate Enrollment Control Instantiation Sample
<BR>
<BR>
<SCRIPT language="VBScript">
<!--
' Declare a local variable.
Dim varName
' Enable error handling.
On Error Resume Next
' Attempt to use the control, in this case to retrieve a property.
varName = Enroll.MyStoreName
' If above line failed, Err.Number will not be 0.
if ( Err.Number <> 0 ) then
MsgBox("Error!")
Err.clear
else
' The control property was successfully retrieved,
' display the property value.
varName = "MyStoreName is " & varName
MsgBox( varName )
end if
-->
</SCRIPT>
<BR>
</HEAD>
</HTML>