I am using a PHP COM Object to Open a Word 2013 file and count pages. My code works great for .docx files but not for .docm files. I am using php 5.4 and IIS 7.5 in a Windows 2008 R2 environment. Any recommendations?
// Create an instance of the Word application
$word = new COM("word.application");
if ($word) {
// Open the document
$word->Documents->Open($file_dir . $filename);
// Get the page count
$pagecount = $word->Documents[1]->ComputeStatistics(2);
}