[wtr-general] OT: WIN32OLE and Word difficulty

2010-12-11 Thread Adam Reed
I've worked with the win32ole library in my WATIR scripts for a long
time, and I've just now stumbled onto a problem that I'm hoping some
of you have also encountered.

I have a script that reads from various Word file formats (doc, docx),
however the documents that are being provided to me from our users
have the text written in a Text Box rather than at the top level of
the document.  When I try to read document.Sentences or .Words, I get
none of this text (just a special character representing the
background image).  I worked through the API and ole_methods and
haven't found anything that seemed to work right yet.

Have any of you had to access this type of object before?  I've posted
on StackOverflow but I know that a lot of you work with win32ole
often, so I thought I'd bring some attention to it here.
http://stackoverflow.com/questions/4419446/how-to-access-textbox-object-text-in-document-using-ruby-win32ole

Thanks,
Adam

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] OT: WIN32OLE and Word difficulty

2010-12-11 Thread Ethan
Hi Adam,
I don't have any experience with OLE stuff in Word, but since I doubt
anybody else here has much either, I can make one general suggestion.
I'd suggest looking for support for COM/OLE automation with Word outside of
the ruby community (definitely outside the watir community - almost all
anybody here is likely to know is IE automation, with a smattering of
Excel). The capabilities that you have using OLE are the same in Ruby as any
other language with bindings for it, but I think that that stuff gets used
in .NET languages much much more than in Ruby, so you're a lot more likely
to find people who know more about things like automating Word using .NET
languages. But since OLE is basically the same no matter what language
you're in, it should be simple to translate anything you learn back to ruby
usage.

On Sat, Dec 11, 2010 at 21:16, Adam Reed reed.a...@gmail.com wrote:

 I've worked with the win32ole library in my WATIR scripts for a long
 time, and I've just now stumbled onto a problem that I'm hoping some
 of you have also encountered.

 I have a script that reads from various Word file formats (doc, docx),
 however the documents that are being provided to me from our users
 have the text written in a Text Box rather than at the top level of
 the document.  When I try to read document.Sentences or .Words, I get
 none of this text (just a special character representing the
 background image).  I worked through the API and ole_methods and
 haven't found anything that seemed to work right yet.

 Have any of you had to access this type of object before?  I've posted
 on StackOverflow but I know that a lot of you work with win32ole
 often, so I thought I'd bring some attention to it here.

 http://stackoverflow.com/questions/4419446/how-to-access-textbox-object-text-in-document-using-ruby-win32ole

 Thanks,
 Adam

 --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com