Index: pkpgcounter/trunk/pkpgpdls/pdlparser.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/pdlparser.py (revision 527)
+++ pkpgcounter/trunk/pkpgpdls/pdlparser.py (revision 529)
@@ -43,10 +43,10 @@
     required = []               # Default list of required commands
     openmode = "rb"             # Default file opening mode
-    def __init__(self, parent, (firstblock, lastblock)) :
+    def __init__(self, parent, filename, (firstblock, lastblock)) :
         """Initialize the generic parser."""
         self.parent = parent
         # We need some copies for later inclusion of parsers which
         # would modify the parent's values
-        self.filename = parent.filename[:]
+        self.filename = filename[:]
         self.firstblock = firstblock[:]
         self.lastblock = lastblock[:]
Index: pkpgcounter/trunk/pkpgpdls/mscrap.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/mscrap.py (revision 527)
+++ pkpgcounter/trunk/pkpgpdls/mscrap.py (revision 529)
@@ -24,5 +24,5 @@
 
 import os
-import urllib2
+import tempfile
 
 import pdlparser
@@ -56,4 +56,26 @@
             
     def getJobSize(self) :
-        """Counts pages in a Microsoft Word (r) (tm) (c) (etc...) document."""
-        return 0
+        """Counts pages in a Microsoft Word (r) (tm) (c) (etc...) document.
+
+           First we convert from .doc to .ps, then we use the PostScript parser.
+        """
+        doctops = 'xvfb-run -a abiword --import-extension=.doc --print="%(outfname)s" "%(infname)s"'
+        workfile = tempfile.NamedTemporaryFile(mode="w+b")
+        try :
+            outfname = workfile.name
+            infname = self.filename
+            status = os.system(doctops % locals())
+            if status or not os.stat(outfname).st_size :
+                raise pdlparser.PDLParserError, "Impossible to convert input document %(infname)s to PostScript" % locals()
+            psinputfile = open(outfname, "rb")
+            try :
+                (first, last) = self.parent.readFirstAndLastBlocks(psinputfile)
+                import postscript
+                return postscript.Parser(self.parent, 
+                                         outfname, 
+                                         (first, last)).getJobSize()
+            finally :
+                psinputfile.close()
+        finally :    
+            workfile.close()
+        raise pdlparser.PDLParserError, "Impossible to count pages in %(infname)s" % locals()
Index: pkpgcounter/trunk/pkpgpdls/analyzer.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/analyzer.py (revision 527)
+++ pkpgcounter/trunk/pkpgpdls/analyzer.py (revision 529)
@@ -166,5 +166,6 @@
                        plain) :     # IMPORTANT : don't move this one up !
             try :               
-                return module.Parser(self, (firstblock, lastblock))
+                return module.Parser(self, self.filename, 
+                                           (firstblock, lastblock))
             except pdlparser.PDLParserError :
                 pass # try next parser
Index: pkpgcounter/trunk/pkpgpdls/version.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/version.py (revision 517)
+++ pkpgcounter/trunk/pkpgpdls/version.py (revision 529)
@@ -22,5 +22,5 @@
 
 
-__version__ = "3.40alpha"
+__version__ = "3.40"
 
 __doc__ = """pkpgcounter : a generic Page Description Languages parser."""
Index: pkpgcounter/trunk/bin/pkpgcounter
===================================================================
--- pkpgcounter/trunk/bin/pkpgcounter (revision 528)
+++ pkpgcounter/trunk/bin/pkpgcounter (revision 529)
@@ -45,4 +45,5 @@
     * DVI
     * OpenDocument (ISO/IEC DIS 26300)
+    * Microsoft Word (c) (tm) (r) (etc...)
     * Plain text
     * TIFF
Index: pkpgcounter/trunk/man/pkpgcounter.1
===================================================================
--- pkpgcounter/trunk/man/pkpgcounter.1 (revision 528)
+++ pkpgcounter/trunk/man/pkpgcounter.1 (revision 529)
@@ -2,7 +2,7 @@
 .TH PKPGCOUNTER "1" "November 2007" "C@LL - Conseil Internet & Logiciels Libres" "User Commands"
 .SH NAME
-pkpgcounter \- manual page for pkpgcounter 3.40alpha
+pkpgcounter \- count number of pages required to print various types of documents
 .SH DESCRIPTION
-pkpgcounter v3.40alpha (c) 2003, 2004, 2005, 2006, 2007 Jerome Alet
+pkpgcounter v3.40 (c) 2003, 2004, 2005, 2006, 2007 Jerome Alet
 .PP
 pkpgcounter is a generic Page Description Language parser.
@@ -22,4 +22,5 @@
 * DVI
 * OpenDocument (ISO/IEC DIS 26300)
+* Microsoft Word (c) (tm) (r) (etc...)
 * Plain text
 * TIFF
@@ -71,5 +72,5 @@
 needed to print all the documents specified.
 .IP
-\f(CW$ pkpgcounter --colorspace bw --resolution 150 file1.ps\fR
+\f(CW$ pkpgcounter \-\-colorspace bw \-\-resolution 150 file1.ps\fR
 .IP
 Will output the percent of black ink needed on each page of
Index: pkpgcounter/trunk/NEWS
===================================================================
--- pkpgcounter/trunk/NEWS (revision 514)
+++ pkpgcounter/trunk/NEWS (revision 529)
@@ -21,4 +21,17 @@
 pkpgcounter News :
 
+  * 3.40 :
+  
+    - Fixed a major bug in the detection of OpenDocument (ISO/IEC DIS 26300)
+      files.
+      
+    - Added support for page counting in Microsoft Word (c) (tm) (r) (etc...)
+      documents.
+      
+    - Added support for ink accounting in Microsoft Word (c) (tm) (r) (etc...)
+      and OpenDocument (ISO/IEC DIS 26300) documents.
+      
+    - Now automatically detects missing executable dependencies at runtime.  
+      
   * 3.30 :
   
Index: pkpgcounter/trunk/README
===================================================================
--- pkpgcounter/trunk/README (revision 528)
+++ pkpgcounter/trunk/README (revision 529)
@@ -36,4 +36,6 @@
         
         - OpenDocument (ISO/IEC DIS 26300)
+        
+        - Microsoft Word (c) (tm) (r) (etc...)
         
         - Plain text
