' *
' summarize.vbs
' *

Rem *** Script Directives ***
Rem On Error Resume Next

set WShell = WScript.CreateObject("WScript.Shell")
Rem dim word

Rem word = "0"

Rem  nlist = array("8.0", "9.0", "10.0", "11.0", "12.0")
Rem  for each n in nlist

Rem 	str = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\"& n &"\Word\InstallRoot\Path"
Rem 	lcValue = WShell.RegRead(str)

Rem 	if (lcValue <> "") Then
Rem 		word = n
Rem 	    lcValue = ""

Rem end if
Rem next


Rem *** Variable Declarations ***

Set application = CreateObject("Word.Application")


Set oArgs = WScript.Arguments
document = oArgs(0)
ascii = oArgs(1)
html = oArgs(2)
rtf = oArgs(3)

application.Visible = false
application.DisplayAlerts = 0
application.Options.VirusProtection = True

application.Documents.open(document)
application.ActiveDocument.SaveAs ascii,2
application.ActiveDocument.SaveAs rtf,6

Rem if (word = "8.0") Then
Rem 	application.ActiveDocument.SaveAs html,102
Rem end if

Rem if (word = "9.0") Then
Rem  	application.ActiveDocument.SaveAs html,8
Rem end if

Rem if (word = "10.0" or word = "11.0" or word = "12.0") Then
 	application.ActiveDocument.SaveAs html,10
Rem end if

Rem WScript.echo "Word: " + word+" "+html

application.quit()
WScript.quit
