Thanks for the example, however I am not having much luck making it work:
$captionsettings = array('show_label' => true, 'text' => 'FIRST IMAGE');
$image->addImage(array('src' => $imagesrc,'imageAlign' => 'center','height' => $picvar[0],'width' => $picvar[1],'caption' => $captionsettings));
I get this error:
Fatal error: Call to a member function saveXML() on a non-object in /var/www/phpdocx_corporate-new2/classes/CreateDocx.inc on line 3376
Am I missing any other parameters?