Dear Friends:

I m trying to read 2 ms word files and then merging both in a new 
file but failed. I m using PHP COM(word.application) for it.

I can create new file and can save it but can't read an existing 
file.

for example
$word = new COM('word.application') or die('Unable to load Word');

print "Loaded Word, version {$word->Version}\n";
$word->visible =1;
$word->Documents->Add();
//$word->Documents->Open("c:\doc1.doc");
$word->Selection->Typetext("Adnan Adnan ....");
$word->Documents[1]->SaveAs ("c:\test.doc",1);
$word->Quit();

This can create a new ms word file and put the contents "Adnan 
Adnan ...." in it and then save in the specified path.

Any idea? how to read 2 different documents and then merging its 
contents, after that saving it as a new .doc file.

sorry 4 bad english...

thanks
Adnan

Reply via email to