home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / COMMON / TOOLS / VCM / VCM.MDB / VcmComponentContainer / 06_Cabinet / modDHTML.bas < prev    next >
Encoding:
BASIC Source File  |  1998-05-18  |  1.3 KB  |  34 lines

  1. Attribute VB_Name = "modDHTML"
  2. 'The following code allows you to use the Web browser's property bag
  3. '   to persist information across different DHTML pages.
  4. Public objWebBrowser As WebBrowser
  5.  
  6. 'PutProperty: Store information in the Property bag by calling this
  7. '             function.  The required inputs are the named Property
  8. '             and the value of the property you would like to store.
  9. '
  10. Public Sub PutProperty(strName As String, vntValue As Variant)
  11.     
  12.     'Check whether we have an instance of the browser.
  13.     If objWebBrowser Is Nothing Then Set objWebBrowser = New WebBrowser
  14.     
  15.     'Call the browser's PutProperty method to store the value.
  16.     objWebBrowser.PutProperty strName, vntValue
  17.  
  18. End Sub
  19.  
  20. 'GetProperty: Retrieve information from the Property bag by calling this
  21. '             function.  The required input is the named Property,
  22. '             and the return value of the function is the current value
  23. '             of the property.
  24. '
  25. Public Function GetProperty(strName As String) As Variant
  26.     
  27.     'Check whether we have an instance of the browser.
  28.     If objWebBrowser Is Nothing Then Set objWebBrowser = New WebBrowser
  29.     
  30.     'Call the browser's GetProperty method to retrieve the value.
  31.     GetProperty = objWebBrowser.GetProperty(strName)
  32.  
  33. End Function
  34.