lubber123 0 Newbie Poster

I am trying to write some simple PHP script to MSWord but am having problems just getting Word enacted. Does anyone have any simple code to bring up Word?

<?php
$msword = new COM("word.application") or die mysql_error("couldnt create an instance of word");
	echo "loaded , word version{$word->version}";
//bring word to the front
	$msword->visible = 1;
//open a word document
	$msword->Documents->Add();
//add some text to the document
	$msword->Selection->TypeText("Hello World!");

?>

I get the echo "loaded + the version - but Word never comes up.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.