dim formatter ' All filenames must be absolute. If they are not, ' the filename will be relative to '\windows\system32' or ' something similar. ' ' XML source file. We're not specifying a stylesheet, so ' this must be a valid XSL-FO file. foFileName = "http://lunasil.com/samples/helloworld.fo" ' XSLT stylesheet styleFileName = Nil ' PDF output filename. pdfFileName = "\helloworld.pdf" On Error Resume Next Set formatter=CreateObject("XincServer.XincFormatter") If Err.number <> 0 Then error = Err.number Err.Clear WScript.Echo("CreateObject() failed: " & error & chr(13) & chr(10) & chr(13) & chr(10) & " You may need to run ComConfig and make sure the configuration is correct.") WScript.Quit(1) End If On Error Resume Next formatter.formatToFile foFileName, styleFileName, pdfFileName If Err.number <> 0 then error = Err.number Err.Clear WScript.Echo("Format Failed: " & "0x" & Hex(error) & chr(13) & chr(10) & chr(13) & chr(10) & formatter.getErrorMsg()) WScript.Quit(2) End If WScript.Echo("Formatted ok!") WScript.Quit(0)