From: Craig Demyanovich Date: 2007-08-24T03:49:41+09:00 Subject: Re: Ruby & Word 2007 help ------=_Part_147886_12210011.1187894971505 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline This problem has captured my attention. I downloaded and installed a trial of Office 2007. Since the error was that the Documents.Open method was missing, I focused my investigation around it. I determined that the method exists and is available to call. Therefore, I decided to write a small program that tries opening a document that is specified in a few different ways. First, here's the program. require 'win32ole' word = WIN32OLE.new('Word.Application') word.Visible = true #doc = word.Documents.Open('C:/Documents and Settings/Administrator/work/test.doc') #doc = word.Documents.Open(File.expand_path(ARGV[0])) doc = word.Documents.Open('C:\Documents and Settings\Administrator\work\test.doc') sleep 5 #seconds word.Quit() Now here's the output of the three runs that I did. C:\Documents and Settings\Administrator\work>ruby opendoc.rb opendoc.rb:5:in `method_missing': Open (WIN32OLERuntimeError) OLE error code:800A1436 in Microsoft Word (C:\//Documents%20and%20Settings/Admin...) HRESULT error code:0x80020009 Exception occurred. from opendoc.rb:5 C:\Documents and Settings\Administrator\work>ruby opendoc.rb test.doc opendoc.rb:6:in `method_missing': Open (WIN32OLERuntimeError) OLE error code:800A1436 in Microsoft Word (C:\//Documents%20and%20Settings/Admin...) HRESULT error code:0x80020009 Exception occurred. from opendoc.rb:6 C:\Documents and Settings\Administrator\work>ruby opendoc.rb C:\Documents and Settings\Administrator\work> Notice that the two times that the path was given with forward slashes, once hard-coded and once from calling File.expand_path() on a file name passed to the program, the program failed. However, when the path was given with backslashes, it succeeded. I'm not sure what to do next, since File.expand_path() returns a path with forward slashes on Windows. Nevertheless, I hope that this information allows the next step toward a solution to be taken. Regards, Craig On 8/23/07, Kyle Schmitt wrote: > > Just a quick hint, since it's saved me a few times when the MSDN site > didn't have good info, use the ole_get_methods, or its analog > ole_methods. > The help method, ole_method_help(), usually doesn't do much other than > return the name of the method in my experience, but heck, try it :) > maybe you'll have more luck. > > --Kyle > > ------=_Part_147886_12210011.1187894971505--