Hi Community,
i´m trying to create a word-document with php using com. It works fine when I create a document with text only. Now I want to add a image to the document. I found the code for that on Internet, but it didn´t work. Can anyone help me out?
Here´s my code:
$text = "My Text";
//Start MS Word
$Word = new COM("word.application") or die("Failure: Word did not start");
echo("WORD has started.");
//Formating the Font
$Word->Visible=0;
$Word->Documents->Add();
$Word->Selection->Font->Name = "Arial";
$Word->Selection->Font->Size = 12;
$Word->Selection->Font->ColorIndex = 4;
//Add text to the document
$Word->Selection->TypeText($text);
//Insert Image
$Word->Selection->InlineShapes->AddPicture = "C:\image.gif";
//Save document
$Word->Documents[1]->SaveAs("c:\myword.doc");
$Word->quit;
Thanks for your Support.
HotteHrubesch