Converter is a *delegate *type in the System namespace (it comes from
mscorlib.dll, not System.dll). You should probably put your class in a
custom namespace like so:
module MyModule
class Converter
...
end
end
On Fri, Nov 20, 2009 at 10:39 AM, Patrick Brown <[email protected]>wrote:
> Hello
>
> Can anyone see why I can't include System in this little script? If I
> do I get an exception 'Converter is not a class (TypeError)'. If I skip the
> include and fully qualify the classes in that namespace this works
> perfectly.
>
> Thanks for your time and ideas,
> Patrick
>
>
>
> require 'System, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089'
> require 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral,
> PublicKeyToken=71e9bce111e9429c'
>
> include System
> include Microsoft::Office::Interop::Word
>
> class Converter
> def Convert(inputDirectories, outputDirectory)
> word = ApplicationClass.new
>
> inputDirectories.each {|inputDirectory|
> Directory.GetFiles(inputDirectory, '*.doc').each { |file|
> documentPath = System::IO::Path.Combine(outputDirectory,
> Path.GetFileNameWithoutExtension(file) + ".xps")
>
> word.Documents.Open(file)
> word.ActiveDocument.SaveAs(documentPath, WdSaveFormat.wdFormatXPS)
> word.ActiveDocument.Close()
> }
>
> word.Quit()
> }
> end
> end
>
> _______________________________________________
> Ironruby-core mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core