# Microsoft Word metadata extraction query

**URL:** <https://www.ruby-forum.com/t/microsoft-word-metadata-extraction-query/195837>\
**Category:** Ruby\
**Created:** [September 30, 2010, 11:27pm UTC](https://www.ruby-forum.com/t/microsoft-word-metadata-extraction-query/195837 "2010-09-30T23:27:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sclarke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b19c9b/32.png) [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Post date:** [September 30, 2010, 11:27pm UTC](https://www.ruby-forum.com/t/microsoft-word-metadata-extraction-query/195837/1 "2010-09-30T23:27:52Z")

</div>

Hey all,

Is anyone aware of a library to identify the use of track changes in  
Microsoft Word documents? I basically and looking for something to scan  
the file and say ‘Track Changes - Y/N’

Many thanks in advance

---

<div class="post-metadata">

**Author:** ![sclarke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b19c9b/32.png) [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Post date:** [October 1, 2010, 2:33am UTC](https://www.ruby-forum.com/t/microsoft-word-metadata-extraction-query/195837/2 "2010-10-01T02:33:00Z")

</div>

Stuart C. wrote:

> Hey all,
> 
> Is anyone aware of a library to identify the use of track changes in  
> Microsoft Word documents? I basically and looking for something to scan  
> the file and say ‘Track Changes - Y/N’
> 
> Many thanks in advance

Not sure if this can be done by “scanning the file”.

It can be done via Win32OLE, by checking the Document object’s  
TrackRevisions property.

require ‘win32ole’  
word = WIN32OLE.new(‘Word.Application’)  
doc = word.Documents.Open(‘c:\stuff.doc’)  
is\_tracking = doc.TrackRevisions

That’s an abbreviated example. Let me know if this would help and you  
need more details.

David

> **[Ruby on Windows](http://rubyonwindows.blogspot.com/search/label/word)**
>
> On using the Ruby programming language on the Microsoft Windows platform

---

<div class="post-metadata">

**Author:** ![sclarke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b19c9b/32.png) [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Post date:** [October 1, 2010, 3:15am UTC](https://www.ruby-forum.com/t/microsoft-word-metadata-extraction-query/195837/3 "2010-10-01T03:15:50Z")

</div>

On Sep 30, 8:33 pm, David M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> David
> 
> ## [Ruby on Windows: word](http://rubyonwindows.blogspot.com/search/label/word)
> 
> Posted viahttp://www.ruby-forum.com/.

Try to run strings (see man strings) on the word doc and see if there  
are any clues.

---

<div class="post-metadata">

**Author:** ![sclarke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b19c9b/32.png) [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Post date:** [October 1, 2010, 11:02pm UTC](https://www.ruby-forum.com/t/microsoft-word-metadata-extraction-query/195837/4 "2010-10-01T23:02:39Z")

</div>

David M. wrote:

> Stuart C. wrote:
> 
> > Hey all,
> > 
> > Is anyone aware of a library to identify the use of track changes in  
> > Microsoft Word documents? I basically and looking for something to scan  
> > the file and say ‘Track Changes - Y/N’
> > 
> > Many thanks in advance
> 
> Not sure if this can be done by “scanning the file”.
> 
> It can be done via Win32OLE, by checking the Document object’s  
> TrackRevisions property.
> 
> require ‘win32ole’  
> word = WIN32OLE.new(‘Word.Application’)  
> doc = word.Documents.Open(‘c:\stuff.doc’)  
> is\_tracking = doc.TrackRevisions
> 
> That’s an abbreviated example. Let me know if this would help and you  
> need more details.
> 
> David
> 
> [Ruby on Windows: word](http://rubyonwindows.blogspot.com/search/label/word)

David,

That is excellent, thanks.

My next issue is getting the gem installed on JRuby. It keeps failing to  
find the gem in the repository, I have had a search around to download  
the compiled gem but I have not been able to find it.

Any ideas?

Many thanks

---

<div class="post-metadata">

**Author:** ![sclarke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b19c9b/32.png) [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Post date:** [October 3, 2010, 3:56am UTC](https://www.ruby-forum.com/t/microsoft-word-metadata-extraction-query/195837/5 "2010-10-03T03:56:13Z")

</div>

Stuart C. wrote:

> My next issue is getting the gem installed on JRuby. It keeps failing to  
> find the gem in the repository, I have had a search around to download  
> the compiled gem but I have not been able to find it.
> 
> Any ideas?

Ah, you’re working with JRuby. Unlike standard Ruby (on Windows),  
JRuby’s install doesn’t include a win32ole library. But it will soon:

[Ruby on Windows: Coming Soon: win32ole for JRuby](http://rubyonwindows.blogspot.com/2010/09/coming-soon-win32ole-for-jruby.html)

A commenter on the above article provides the following URLs:

[http://github.com/enebo/jacob](http://github.com/enebo/jacob)

[http://github.com/enebo/jrwin32ole](http://github.com/enebo/jrwin32ole)

I haven’t tried these yet, but they may meet your needs until JRuby 1.6  
is released.

David

---

<div class="post-metadata">

**Author:** ![sclarke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b19c9b/32.png) [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Post date:** [October 3, 2010, 11:45am UTC](https://www.ruby-forum.com/t/microsoft-word-metadata-extraction-query/195837/6 "2010-10-03T11:45:44Z")

</div>

David M. wrote:

> Stuart C. wrote:
> 
> > My next issue is getting the gem installed on JRuby. It keeps failing to  
> > find the gem in the repository, I have had a search around to download  
> > the compiled gem but I have not been able to find it.
> > 
> > Any ideas?
> 
> Ah, you’re working with JRuby. Unlike standard Ruby (on Windows),  
> JRuby’s install doesn’t include a win32ole library. But it will soon:
> 
> [Ruby on Windows: Coming Soon: win32ole for JRuby](http://rubyonwindows.blogspot.com/2010/09/coming-soon-win32ole-for-jruby.html)
> 
> A commenter on the above article provides the following URLs:
> 
> [http://github.com/enebo/jacob](http://github.com/enebo/jacob)
> 
> [http://github.com/enebo/jrwin32ole](http://github.com/enebo/jrwin32ole)
> 
> I haven’t tried these yet, but they may meet your needs until JRuby 1.6  
> is released.
> 
> David

David,

Thanks for getting back to me.

I have tried both of these GEM’s and both fail to install and I get the  
following error:

C:\jruby-1.5.3\bin\>jruby -S gem install jrwin32ole  
JRuby limited openssl loaded. [http://jruby.org/openssl](http://jruby.org/openssl)  
gem install jruby-openssl for full support.  
ERROR: could not find gem jrwin32ole locally or in a repository

Many thanks

---

<div class="post-metadata">

**Author:** ![sclarke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b19c9b/32.png) [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Post date:** [October 3, 2010, 11:45am UTC](https://www.ruby-forum.com/t/microsoft-word-metadata-extraction-query/195837/7 "2010-10-03T11:45:34Z")

</div>

David M. wrote:

> Stuart C. wrote:
> 
> > My next issue is getting the gem installed on JRuby. It keeps failing to  
> > find the gem in the repository, I have had a search around to download  
> > the compiled gem but I have not been able to find it.
> > 
> > Any ideas?
> 
> Ah, you’re working with JRuby. Unlike standard Ruby (on Windows),  
> JRuby’s install doesn’t include a win32ole library. But it will soon:
> 
> [Ruby on Windows: Coming Soon: win32ole for JRuby](http://rubyonwindows.blogspot.com/2010/09/coming-soon-win32ole-for-jruby.html)
> 
> A commenter on the above article provides the following URLs:
> 
> [http://github.com/enebo/jacob](http://github.com/enebo/jacob)
> 
> [http://github.com/enebo/jrwin32ole](http://github.com/enebo/jrwin32ole)
> 
> I haven’t tried these yet, but they may meet your needs until JRuby 1.6  
> is released.
> 
> David

David,

Thanks for getting back to me.

I have tried both of these GEM’s and both fail to install and I get the  
following error:

C:\jruby-1.5.3\bin\>jruby -S gem install jrwin32ole  
JRuby limited openssl loaded. [http://jruby.org/openssl](http://jruby.org/openssl)  
gem install jruby-openssl for full support.  
ERROR: could not find gem jrwin32ole locally or in a repository

Many thanks

Stuart
