Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for offver.vbs

(view source code of offver.vbs as plain text)

  1. ' Demo: list versions/builds of Microsoft Office programs
  2. ' Written by Rob van der Woude
  3. ' http://www.robvanderwoude.com
  4.  
  5. Option Explicit
  6.  
  7. Dim objAccess, objExcel, objOutlook, objPpt, objVisio, objWord
  8. Dim strMsg, strVer
  9.  
  10. strMsg = ""
  11.  
  12. On Error Resume Next
  13.  
  14. Set objAccess = CreateObject( "Access.Application" )
  15. strVer = ""
  16. strVer = objAccess.Version
  17. strVer = strVer & "." & objAccess.Build
  18. strVer = objAccess.BuildFull
  19. strMsg = strMsg & vbCrLf & objAccess.Name & ": " & strVer
  20. objAccess.Quit
  21. Set objAccess = Nothing
  22.  
  23. Set objExcel = CreateObject( "Excel.Application" )
  24. strVer = ""
  25. strVer = objExcel.Version
  26. strVer = strVer & "." & objExcel.Build
  27. strVer = objExcel.BuildFull
  28. strMsg = strMsg & vbCrLf & objExcel.Name & ": " & strVer
  29. objExcel.Quit
  30. Set objExcel = Nothing
  31.  
  32. Set objOutlook = CreateObject( "Outlook.Application" )
  33. strVer = ""
  34. strVer = objOutlook.Version
  35. strVer = objOutlook.Build
  36. strVer = objOutlook.BuildFull
  37. strMsg = strMsg & vbCrLf & objOutlook.Name & ": " & strVer
  38. objOutlook.Quit
  39. Set objOutlook = Nothing
  40.  
  41. Set objPpt = CreateObject( "PowerPoint.Application" )
  42. strVer = ""
  43. strVer = objPpt.Version
  44. strVer = strVer & "." & objPpt.Build
  45. strVer = objPpt.BuildFull
  46. strMsg = strMsg & vbCrLf & objPpt.Name & ": " & strVer
  47. objPpt.Quit
  48. Set objPpt = Nothing
  49.  
  50. Set objVisio = CreateObject( "Visio.Application" )
  51. strVer = ""
  52. strVer = objVisio.Version
  53. strVer = objVisio.Build
  54. strVer = objVisio.BuildFull
  55. strMsg = strMsg & vbCrLf & objVisio.Name & ": " & strVer
  56. objVisio.Quit
  57. Set objVisio = Nothing
  58.  
  59. Set objWord = CreateObject( "Word.Application" )
  60. strVer = ""
  61. strVer = objWord.Version
  62. strVer = objWord.Build
  63. strVer = objWord.BuildFull
  64. strMsg = strMsg & vbCrLf & objWord.Name & ": " & strVer
  65. objWord.Quit
  66. Set objWord = Nothing
  67.  
  68. On Error Goto 0
  69.  
  70. WScript.Echo strMsg
  71.  

page last modified: 2024-04-16; loaded in 0.0066 seconds