From: Heesob Park Date: 2008-12-12T22:45:08+09:00 Subject: Re: How to get contents of word file page by page 2008/12/12 Talib Hussain : > Hi, > > I have a 3 paged document, I want to read contents of each page. How cn > i do that. > If you want only text contents, 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 for i in 1..page word.selection.goto(1,1,i) # wdGoToPage = 1 word.selection.goto(-1,0,0,'\page') # wdGoToBookmark = -1 puts "PAGE #{i}" puts word.selection.text end word.activedocument.close(false) word.quit Regards, Park Heesob