Connecting to Outlook 'Saved Items' folder using win32ole

Discussion in 'Ruby' started by Alex DeCaria, Dec 12, 2007.

  1. Alex DeCaria

    Alex DeCaria Guest

    Can anyone tell me how to connect to the 'Saved Items' folder in Outlook
    using WIN32OLE? I can get to all the other folders using
    GetDefaultFolder(), but I can't seem to get to the 'Saved Items' folder
    this way. mapi.Folders.Item('Saved Items') doesn't do it either.

    Thanks in advance. Alex
    --
    Posted via http://www.ruby-forum.com/.
     
    Alex DeCaria, Dec 12, 2007
    #1
    1. Advertising

  2. Re: Connecting to Outlook 'Saved Items' folder using win32ol

    I'm curious. Are you connecting to Outlook through an Exchange Server
    or a stand-alone client?

    Bill


    Alex DeCaria wrote:
    > Can anyone tell me how to connect to the 'Saved Items' folder in Outlook
    > using WIN32OLE? I can get to all the other folders using
    > GetDefaultFolder(), but I can't seem to get to the 'Saved Items' folder
    > this way. mapi.Folders.Item('Saved Items') doesn't do it either.
    >
    > Thanks in advance. Alex


    --
    Posted via http://www.ruby-forum.com/.
     
    Bill Davenport, Dec 12, 2007
    #2
    1. Advertising

  3. Alex DeCaria

    Alex DeCaria Guest

    Re: Connecting to Outlook 'Saved Items' folder using win32ol

    Bill Davenport wrote:
    > I'm curious. Are you connecting to Outlook through an Exchange Server
    > or a stand-alone client?
    >
    > Bill
    >
    >
    > Alex DeCaria wrote:
    >> Can anyone tell me how to connect to the 'Saved Items' folder in Outlook
    >> using WIN32OLE? I can get to all the other folders using
    >> GetDefaultFolder(), but I can't seem to get to the 'Saved Items' folder
    >> this way. mapi.Folders.Item('Saved Items') doesn't do it either.
    >>
    >> Thanks in advance. Alex


    Bill,

    I'm connecting through an exhange server. I am able to access my inbox,
    deleted items, etc., and also my 'personal folders'. I just can't
    figure out how to get to the 'saved items'.

    Alex
    --
    Posted via http://www.ruby-forum.com/.
     
    Alex DeCaria, Dec 12, 2007
    #3
  4. Re: Connecting to Outlook 'Saved Items' folder using win32ol

    Alex DeCaria wrote:
    > Bill Davenport wrote:
    >> I'm curious. Are you connecting to Outlook through an Exchange Server
    >> or a stand-alone client?
    >>
    >> Bill
    >>
    >>
    >> Alex DeCaria wrote:
    >>> Can anyone tell me how to connect to the 'Saved Items' folder in Outlook
    >>> using WIN32OLE? I can get to all the other folders using
    >>> GetDefaultFolder(), but I can't seem to get to the 'Saved Items' folder
    >>> this way. mapi.Folders.Item('Saved Items') doesn't do it either.
    >>>
    >>> Thanks in advance. Alex

    >
    > Bill,
    >
    > I'm connecting through an exhange server. I am able to access my inbox,
    > deleted items, etc., and also my 'personal folders'. I just can't
    > figure out how to get to the 'saved items'.
    >
    > Alex


    Alex,

    I have ubuntu and if I open a file browser and you should be able to
    connect the Exchange server. This will let you view the contents of your
    Sent Items.
    dav://<owa link>/exchange/<user account>/Sent%20Items

    I haven't used the win32ole so I chose to use what Exchange uses
    natively -- WebDAV. I hope this helps.

    If you know what you're looking for within the Sent Items folder I have
    some code.
    --
    Posted via http://www.ruby-forum.com/.
     
    Bill Davenport, Dec 12, 2007
    #4
  5. Alex DeCaria

    Alex DeCaria Guest

    Re: Connecting to Outlook 'Saved Items' folder using win32ol

    > Alex,
    >
    > I have ubuntu and if I open a file browser and you should be able to
    > connect the Exchange server. This will let you view the contents of your
    > Sent Items.
    > dav://<owa link>/exchange/<user account>/Sent%20Items
    >
    > I haven't used the win32ole so I chose to use what Exchange uses
    > natively -- WebDAV. I hope this helps.
    >
    > If you know what you're looking for within the Sent Items folder I have
    > some code.


    Bill,

    Thanks for your time and patience. It's actually the 'Saved Items' that
    I'm trying to access, not the 'Sent Items' (which I am able to access).
    Underneath the 'Saved Items' I have a bunch of sub-folders where I am
    storing e-mails that are kept on our server. If I move one of those
    folders into the 'Personal Folders' I can then access it, but then it is
    on my local machine and no longer on our server.

    So my issue is, I can get to 'Inbox', 'Sent Items', 'Appointments',
    'Deleted Items', and 'Personal Folders', but just not 'Saved Items'.

    I think my issue is a WIN32OLE issue, but again I thank you for your
    time in trying to help.

    - Alex

    --
    Posted via http://www.ruby-forum.com/.
     
    Alex DeCaria, Dec 12, 2007
    #5
  6. Re: Connecting to Outlook 'Saved Items' folder using win32ol

    >
    > Bill,
    >
    > Thanks for your time and patience. It's actually the 'Saved Items' that
    > I'm trying to access, not the 'Sent Items' (which I am able to access).
    > Underneath the 'Saved Items' I have a bunch of sub-folders where I am
    > storing e-mails that are kept on our server. If I move one of those
    > folders into the 'Personal Folders' I can then access it, but then it is
    > on my local machine and no longer on our server.
    >
    > So my issue is, I can get to 'Inbox', 'Sent Items', 'Appointments',
    > 'Deleted Items', and 'Personal Folders', but just not 'Saved Items'.
    >
    > I think my issue is a WIN32OLE issue, but again I thank you for your
    > time in trying to help.
    >
    > - Alex


    I misread. Is 'Saved Items' a folder you created. Look at the structure
    I don't see it. I don't see it in OWA or in Outlook either.

    bill
    --
    Posted via http://www.ruby-forum.com/.
     
    Bill Davenport, Dec 12, 2007
    #6
  7. Alex DeCaria

    Alex DeCaria Guest

    Re: Connecting to Outlook 'Saved Items' folder using win32ol

    Bill Davenport wrote:
    > I misread. Is 'Saved Items' a folder you created. Look at the structure
    > I don't see it. I don't see it in OWA or in Outlook either.
    >
    > bill


    Bill,

    Yes, actually it is one I created. I should have been more specific.
    But I did create it on the server-side of things, so it resides as a
    subfolder under my 'Mailbox'. I'm now thinking that may be why I can't
    access it, because maybe WIN32OLE can't recognize it.

    Alex
    --
    Posted via http://www.ruby-forum.com/.
     
    Alex DeCaria, Dec 12, 2007
    #7
  8. Re: Connecting to Outlook 'Saved Items' folder using win32ol

    Alex DeCaria wrote:
    > Bill Davenport wrote:
    >> I misread. Is 'Saved Items' a folder you created. Look at the structure
    >> I don't see it. I don't see it in OWA or in Outlook either.
    >>
    >> bill

    >
    > Bill,
    >
    > Yes, actually it is one I created. I should have been more specific.
    > But I did create it on the server-side of things, so it resides as a
    > subfolder under my 'Mailbox'. I'm now thinking that may be why I can't
    > access it, because maybe WIN32OLE can't recognize it.
    >
    > Alex


    I created a 'Saved Items' and was able to access it using WebDAV.

    Try this in irb.

    require 'uri'
    require 'net/http'
    include Exchange
    uri_path = URI.parse("http:////<owa link>/exchange/<user
    account>/Sent%20Items/<filename>.eml")
    request = Net::HTTP::Get.new(uri_path.path, {"translate" => "F"})
    login = "login"
    pass = "password"
    request.basic_auth(login, pass)
    response = Net::HTTP.start(uri_path.host) {|http| http.request(request)}
    response.body

    BTW: I have to leave on a trip. Good luck with you project.

    -bill
    --
    Posted via http://www.ruby-forum.com/.
     
    Bill Davenport, Dec 12, 2007
    #8
  9. Re: Connecting to Outlook 'Saved Items' folder using win32ol

    >> include Exchange

    OOPS: DO NOT USE THE "include Exchange". That was a typo.
    --
    Posted via http://www.ruby-forum.com/.
     
    Bill Davenport, Dec 12, 2007
    #9
  10. Alex DeCaria

    Alex DeCaria Guest

    Re: Connecting to Outlook 'Saved Items' folder using win32ol

    Bill Davenport wrote:
    >>> include Exchange

    >
    > OOPS: DO NOT USE THE "include Exchange". That was a typo.


    Bill,

    OK. Thanks for the help. I'll give it a try! Enjoy your trip.

    Alex
    --
    Posted via http://www.ruby-forum.com/.
     
    Alex DeCaria, Dec 12, 2007
    #10
  11. Alex DeCaria

    Alex DeCaria Guest

    Re: Connecting to Outlook 'Saved Items' folder using win32ol

    Bill,

    As closure, I did figure out a way to do this in Windows using WIN32OLE.
    The attached program will locate a folder in the Outlook Mailbox, and
    then print the names of any subfolders in the folder as well as the
    subjects of any messages in the folder.

    Thanks again for taking the time to help.

    Alex

    Attachments:
    http://www.ruby-forum.com/attachment/1141/outlook_explore.rb

    --
    Posted via http://www.ruby-forum.com/.
     
    Alex DeCaria, Dec 13, 2007
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    390
    Daniel Fisher\(lennybacon\)
    Nov 30, 2005
  2. =?Utf-8?B?Unlv?=

    Read the content of a saved Outlook message...

    =?Utf-8?B?Unlv?=, Oct 24, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    306
    John Timney \(MVP\)
    Oct 24, 2006
  3. Steve Tuckner

    [WIN32OLE] Outlook Automation Question

    Steve Tuckner, Jun 26, 2003, in forum: Ruby
    Replies:
    0
    Views:
    199
    Steve Tuckner
    Jun 26, 2003
  4. Masaki Suketa
    Replies:
    4
    Views:
    398
    Dave Burt
    Mar 27, 2006
  5. zxem
    Replies:
    1
    Views:
    251
Loading...

Share This Page