Would it not be easier to use the replace variable?
$docx = new CreateDocx();
$docx->addTemplate('Template.docx');
for($index=1; $index <$numberofstrings;$index++){
$docx->addTemplateVariable('string'.$index,'string'.$index);
}
$docx->createDocx('Files/Report');