home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Data 2004 February / CD Rom Data Şubat 2004.iso / Media / Internet / host-mon.exe / Examples / Scripts / CheckWord.vbs next >
Encoding:
Text File  |  2002-10-22  |  1.2 KB  |  34 lines

  1. '-----------------------------------------------------------------------------
  2. 'File    : CheckWord.VBS
  3. 'Purpose : Sample script test for Advanced Host Monitor
  4. 'Comment : Statrs MS Word, opens document and returns number of characters in 
  5. '          the document. If Microsoft Word is not installed or document does 
  6. '          not exist, test's status will be "Uknown"
  7. 'Req     : 
  8. 'Language: VBScript
  9. 'Version : 1.0
  10. 'Author  : KS-Soft (www.ks-soft.net)
  11. '-----------------------------------------------------------------------------
  12. Option Explicit
  13.  
  14. const statusAlive       = "Host is alive:"
  15. const statusDead        = "No answer:"
  16. const statusUnknown     = "Unknown:"
  17. const statusNotResolved = "Unknown host:"
  18. const statusOk          = "Ok:"
  19. const statusBad         = "Bad:"
  20. const statusBadContents = "Bad contents:"
  21.  
  22. const FileName = "C:\My Documents\Test1.doc"
  23.  
  24. '---- entry point ----
  25.  
  26. FUNCTION performtest()
  27.  Dim MSWord
  28.  Set MSWord = CreateObject("Word.Application")
  29.  MSWord.Documents.Open(FileName)
  30.  performtest="Ok:"+FormatNumber(MSWord.ActiveDocument.Characters.Count,0)
  31.  MSWord.Application.Quit   
  32.  Set MSWord = Nothing      
  33. END FUNCTION
  34.