7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/doc2html.rb', line 7
def convertDoc(docpath,savepath)
if File.exists?(docpath)
docfullpath = File.expand_path(docpath)
savefullpath = File.expand_path(savepath)
word = WIN32OLE.new('word.application')
quitWord = word.documents.count == 0
word.documents.open(docfullpath)
word.activedocument.trackrevisions = false
word.activedocument.revisions.acceptall
word.activedocument.saveas savefullpath, 10 word.activedocument.close(false)
word.quit if quitWord
end
end
|