How to get the character count from a Word document
Sometimes we may need to know the total characters in a word document. We can do this by creating a COM object.. Sample code: $word = new COM(“word.application”) or die(“Unable to instanciate Word”); $word->Visible = 0; $word->Documents->Open(“D:\test\xyz.doc”); // give the path to your word document $total_characters_in doc = $word->ActiveDocument->Characters->Count; $total_paragraph = $word->ActiveDocument->Paragraphs->Count; So now from […]