I did a search and found some codes but I have an error message for loading a Word document.
Codes :
function openSheet($folderToOpen)
{
com_load_typelib('Word.Application');
$word = new COM('word.application') or die('Unable to load Word');
$word->Documents->Open('c:/PatientsRecords/' .$folderToOpen . '/PatientData/BlueSheet.dot');
}
Error Message :
Fatal error: Uncaught exception 'com_exception' with message 'Source: Microsoft Word
Description: Could not open macro storage.' in F:\Hospital\submenu.php:298 Stack trace: #0 F:\Hospital\mainmenu.php(189): openSheet('c:/PatientsReco...') #1 {main} thrown in F:\Hospital\submenu.php on line 298
Can anyone please help me to solve this problem?