From: "Dwayne Smurdon @ DNA Media Pro" Date: 2003-02-01T13:54:16+09:00 Subject: Creating a Folder in Outlook This is a multi-part message in MIME format. ------=_NextPart_000_0186_01C2C983.AD3F22D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Ok, I broke down and bought "Programming Microsoft Outlook 2000" book - but I still can't find the solution to this question in it. I am simply trying to create a folder called "test" inside my default contacts folder. Of course, I want to be able to do this in other folders too. Here is what I think it should be, but the compiler doesn't like it. :) outlook = WIN32OLE.new("outlook.application") oNameSpace = outlook.getNameSpace('MAPI'); @@contactFolder = oNameSpace.GetDefaultFolder(10) @@contactFolder.add("test", 10) # 10 is optional The last line is incorrect (and is line 7): ./OutlookContact.rb:7:in `method_missing': Unknown property or method : `add' (WIN32OLERuntimeError) HRESULT error code:0x80020006 Unknown name from ./OutlookContact.rb:7:in `initialize' from D:/Apps/Ruby/projects/DbConn.rb:9:in `new' from D:/Apps/Ruby/projects/DbConn.rb:9 Any help would be appreciated. -Dwayne ------=_NextPart_000_0186_01C2C983.AD3F22D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Creating a Folder in Outlook

Ok, I broke down and bought "Programming = Microsoft Outlook 2000" book - but I still can't find the solution = to this question in it.


I am simply trying to create a folder called = "test" inside my default contacts folder.  Of course, I = want to be able to do this in other folders too.  Here is what I = think it should be, but the compiler doesn't like it. :)


    outlook =3D = WIN32OLE.new("outlook.application")
    oNameSpace =3D = outlook.getNameSpace('MAPI');
    @@contactFolder =3D = oNameSpace.GetDefaultFolder(10)
    = @@contactFolder.add("test", 10) # 10 is optional


The last line is incorrect (and is line 7):

./OutlookContact.rb:7:in `method_missing': Unknown = property or method : `add' (WIN32OLERuntimeError)
    HRESULT error = code:0x80020006
      Unknown name
        from = ./OutlookContact.rb:7:in `initialize'
        from = D:/Apps/Ruby/projects/DbConn.rb:9:in `new'
        from = D:/Apps/Ruby/projects/DbConn.rb:9



Any help would be appreciated.

-Dwayne

------=_NextPart_000_0186_01C2C983.AD3F22D0--