I know - all I say is that I am now documenting everything I do, and will post it as and when I get it working....
Looks like the coding side was working, but I have looked more into the CLSID error I am getting now, which seems to refer more to having the wrong user logged into the system (and you can't change or add one if it is NT Server as a domain controller supposedly) either that or it is a DLL error...
BUT..... the javascript code of...
<SCRIPT LANGUAGE="JavaScript">
<!--
function runWord() {
var
wordApp = new ActiveXObject("word.Application");
wordApp.Visible=true;
wordApp.documents.add();
wordApp.Selection.TypeText("<?=$text?>");
wordApp.Selection.TypeParagraph();
wordApp.Activedocument.SaveAs("<?=$file?>");
wordApp.Application.Quit();
}
runWord();//-->
also gives an error of "The Automation server can't create object"
So definately NOT a PHP coding error, but a server related error...
I have also seen that changing over to Apache solved this problem, which seems to lie in IIS somewhere, (conflicting view I know...) this is a non starter for me though, because of the corporate IT people refusing to even try it, and denying me access to install it as well.
So back to square one... trying to get it working... I'll keep you posted...
Additional Notes
These are supplemental for anyone having the errors documented below
Known posisble errors...
Run-time error '5981' (0x800A175D): Could not open macro storage
-or-
Run-time error '1004': Method '~' of object '~' failed
Typically, this is the result of failing to initialize VBA due to insufficient permissions or due to a lack of VBA component registration, both of which are typical when a user runs code from an account with no user profile (issue #1) and the user token does not contain the Interactive SID (issue #2).
See: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q257757
Suggested Alternatives:
Most server-side Automation tasks involve document creation. Because Office 2000 and later support HTML as a native document format, most documents can be created in HTML, using Extensible Markup Language (XML) markup when needed, and streamed to a client by using a Multipurpose Internet Mail Extensions (MIME) type so that the resulting text is displayed in Office. The document can be edited, saved, and even returned to the server when needed, by using nothing more than ASP on the server. For earlier versions of Office, other easily manipulated text formats (like RTF) can be used to the same effect.
Taken from the Microsoft website... the site which also states "Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when run in this environment."
Will add more as I can...