lib/PHPWord/PHPWord/Section/Table/Cell.php
public function addObject($src, $style = null) {
		$object = new PHPWord_Section_Object($src, $style);
		
		if(!is_null($object->getSource())) {
			$inf = pathinfo($src);
			$ext = $inf['extension'];
			if(strlen($ext) == 4 && strtolower(substr($ext, -1)) == 'x') {
				$ext = substr($ext, 0, -1);
			}
			
			$iconSrc = PHPWORD_BASE_PATH . 'PHPWord/_staticDocParts/';
			if(!file_exists($iconSrc.'_'.$ext.'.png')) {
				$iconSrc = $iconSrc.'_default.png';
			} else {
				$iconSrc .= '_'.$ext.'.png';
			}
			
			$rIDimg = PHPWord_Media::addSectionMediaElement($iconSrc, 'image');
			$data = PHPWord_Media::addSectionMediaElement($src, 'oleObject');
			$rID = $data[0];
			$objectId = $data[1];
			
			$object->setRelationId($rID);
			$object->setObjectId($objectId);
			$object->setImageRelationId($rIDimg);
			
			$this->_elementCollection[] = $object;
			return $object;
		} else {
			trigger_error('Source does not exist or unsupported object type.');
		}
	}
public function addObject($src, $style = null) {
		$object = new PHPWord_Section_Object($src, $style);
		
		if(!is_null($object->getSource())) {
			$inf = pathinfo($src);
			$ext = $inf['extension'];
			if(strlen($ext) == 4 && strtolower(substr($ext, -1)) == 'x') {
				$ext = substr($ext, 0, -1);
			}
			
			$iconSrc = PHPWORD_BASE_PATH . 'PHPWord/_staticDocParts/';
			if(!file_exists($iconSrc.'_'.$ext.'.png')) {
				$iconSrc = $iconSrc.'_default.png';
			} else {
				$iconSrc .= '_'.$ext.'.png';
			}
			
			$rIDimg = PHPWord_Media::addSectionMediaElement($iconSrc, 'image');
			$data = PHPWord_Media::addSectionMediaElement($src, 'oleObject');
			$rID = $data[0];
			$objectId = $data[1];
			
			$object->setRelationId($rID);
			$object->setObjectId($objectId);
			$object->setImageRelationId($rIDimg);
			
			$this->_elementCollection[] = $object;
			return $object;
		} else {
			trigger_error('Source does not exist or unsupported object type.');
		}
	}
public function addObject ( $ src , $ style = null ) { $ object = new PHPWord_Section_Object ( $ src , $ style ) ; if ( ! is_null ( $ object -> getSource ( ) ) ) { $ inf = pathinfo ( $ src ) ; $ ext = $ inf [ 'extension' ] ; if ( strlen ( $ ext ) == 4 && strtolower ( substr ( $ ext , - 1 ) ) == 'x' ) { $ ext = substr ( $ ext , 0 , - 1 ) ; } $ iconSrc = PHPWORD_BASE_PATH . 'PHPWord/_staticDocParts/' ; if ( ! file_exists ( $ iconSrc . '_' . $ ext . '.png' ) ) { $ iconSrc = $ iconSrc . '_default.png' ; } else { $ iconSrc .= '_' . $ ext . '.png' ; } $ rIDimg = PHPWord_Media :: addSectionMediaElement ( $ iconSrc , 'image' ) ; $ data = PHPWord_Media :: addSectionMediaElement ( $ src , 'oleObject' ) ; $ rID = $ data [ 0 ] ; $ objectId = $ data [ 1 ] ; $ object -> setRelationId ( $ rID ) ; $ object -> setObjectId ( $ objectId ) ; $ object -> setImageRelationId ( $ rIDimg ) ; $ this -> _elementCollection [ ] = $ object ; return $ object ; } else { trigger_error ( 'Source does not exist or unsupported object type.' ) ; } }
Add a OLE-Object Element

@param string $src
@param mixed $style
@return PHPWord_Section_Object
Add a OLE - Object Element