Microsoft Word metadata extraction query

S

Stuart Clarke

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
 
D

David Mullet

Stuart said:
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

http://rubyonwindows.blogspot.com/search/label/word
 
R

(r.*n){2}

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

http://rubyonwindows.blogspot.com/search/label/word

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

Stuart Clarke

David said:
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

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
 
D

David Mullet

Stuart said:
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:

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/jrwin32ole

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

David
 
S

Stuart Clarke

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

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/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
gem install jruby-openssl for full support.
ERROR: could not find gem jrwin32ole locally or in a repository

Many thanks

Stuart
 
S

Stuart Clarke

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

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/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
gem install jruby-openssl for full support.
ERROR: could not find gem jrwin32ole locally or in a repository

Many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top