Benoit,

Thank You.  That helps alot!

kk

"Benoit Cerrina" <benoit.cerrina / writeme.com> wrote in message news:<9t8gap$m5v$1 / wanadoo.fr>...
> > 'olMailItem' is a predefined object from Outlook's object model (there
> > are several objects...folders, calenders etc). The 'CreateItem' method
> > takes this as it argument. I also tried passing the value "0" which is
> > the integer representation of that object. I am assuming the via the
> > WIN32OLE module that I have access to the full object model?  I
> > haven't had many problems with excel or word. If my syntax is wrong,
> > please correct me.
> >
> > thxs,
> > KK
> OK,
> I had never done it but a quick check at the msdn and the ruby book tells me
> olMailItem is a constant and that such constant needs to be explicitly
> loaded
> in a class to be available. So I did:
> 
> irb(main):024:0> class OutlookConst
> irb(main):025:1> end
> nil
> irb(main):026:0> OutlookConst.inspect
> "OutlookConst"
> irb(main):027:0> WIN32OLE.const_load(olApp, Outlook)
> 
> then
> irb(main):028:0> Outlook.constants
> ["OlRemoteUser", "OlTaskRequestUpdate", "OlMenu", "OlFolders", "OlNumber",
> "OlHome", "OlPersonal",
> ..."OlMailItem"...
> ]
> ok so the constant names have an uppercase first later to comply with ruby's
> idea of a constant.
> 
> then
> irb(main):031:0> oleApp.CreateItem(Outlook::OlMailItem)
> #<WIN32OLE:0x100b8bc8>
> victory ;-)
> Benoit