Heesob Park
12/12/2008 8:55:00 AM
Hi,
2008/12/12 Talib Hussain <talibhn@gmail.com>:
> Hi,
>
> Could you let me know how can I count the no. of pages in a Word
> document using Ruby?
>
Try this:
require 'win32ole'
word = WIN32OLE.new('word.application')
file = 'c:/work/test.doc'
doc = word.documents.open(file,'ReadOnly' => true)
page = doc.ComputeStatistics(2) # wdStatisticPages = 2
word.activedocument.close(false)
word.quit
puts page
HTH,
Park Heesob