[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Connecting to Outlook 'Saved Items' folder using win32ole

Alex DeCaria

12/12/2007 8:30:00 PM

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-....

10 Answers

Bill Davenport

12/12/2007 8:34:00 PM

0

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-....

Alex DeCaria

12/12/2007 8:38:00 PM

0

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-....

Bill Davenport

12/12/2007 9:18:00 PM

0

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-....

Alex DeCaria

12/12/2007 9:28:00 PM

0

> 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-....

Bill Davenport

12/12/2007 9:34:00 PM

0

>
> 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-....

Alex DeCaria

12/12/2007 9:41:00 PM

0

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-....

Bill Davenport

12/12/2007 10:15:00 PM

0

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-....

Bill Davenport

12/12/2007 10:17:00 PM

0

>> include Exchange

OOPS: DO NOT USE THE "include Exchange". That was a typo.
--
Posted via http://www.ruby-....

Alex DeCaria

12/12/2007 10:43:00 PM

0

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-....

Alex DeCaria

12/13/2007 3:31:00 PM

0

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-...attachment/1141/outlook_...

--
Posted via http://www.ruby-....