Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   How to archive mails using VSTO 3.0 (http://www.outlookbanter.com/add-ins-outlook/85680-how-archive-mails-using-vsto.html)

Pradeep Yamujala February 5th 09 03:51 AM

How to archive mails using VSTO 3.0
 
Hi all,

I am developing a outlook plugin for one organization. In one of the
requirment i have to archive a mail, and retrive back when ever necessory. I
need to do searching also.

But unfortunatly i am not getting goon info about how to?. Please
help me how to perform archiving function using C# in VSTO.

Thanks in advance.

Ken Slovak - [MVP - Outlook] February 5th 09 02:59 PM

How to archive mails using VSTO 3.0
 
Archive what email? How is it selected or identified? Where is it located?
Archive to where? Provide actual details of what you want so people don't
have to try to read your mind over the Internet, that doesn't work very
well.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Pradeep Yamujala" wrote in
message ...
Hi all,

I am developing a outlook plugin for one organization. In one of
the
requirment i have to archive a mail, and retrive back when ever necessory.
I
need to do searching also.

But unfortunatly i am not getting goon info about how to?. Please
help me how to perform archiving function using C# in VSTO.

Thanks in advance.



Pradeep Yamujala February 6th 09 03:41 AM

How to archive mails using VSTO 3.0
 
Hi Ken,

In my client environment, they are using exchange server. In that
they created few shared inboxes. All the users has their own dedicated mail
accounts. These shared inboxes attached to the dedicated mail accounts so
that when they login able to retrive these inboxes.

As per my knowledge the archival file might be in the exchange
server only. What my plugin must do is, what ever mail they selected must go
in archives oncce he clicked on "Archive" button. Also I must search the
mails in archives also, if user wants he can retrive the same.

At this point i want to know how to pweform this archival
operation using VSTO 3.0 and C#. And also how to search in the archive folder.

I hope this explains my doubt. Please help me to solve this problem.

Thanks
Pradeep Yamujala.
------------------------------------------------------------------------------------------

"Ken Slovak - [MVP - Outlook]" wrote:

Archive what email? How is it selected or identified? Where is it located?
Archive to where? Provide actual details of what you want so people don't
have to try to read your mind over the Internet, that doesn't work very
well.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Pradeep Yamujala" wrote in
message ...
Hi all,

I am developing a outlook plugin for one organization. In one of
the
requirment i have to archive a mail, and retrive back when ever necessory.
I
need to do searching also.

But unfortunatly i am not getting goon info about how to?. Please
help me how to perform archiving function using C# in VSTO.

Thanks in advance.




Ken Slovak - [MVP - Outlook] February 6th 09 02:54 PM

How to archive mails using VSTO 3.0
 
To get a shared Inbox folder you would use
NameSpace.GetSharedDefaultFolder(). That method takes a Recipient object and
folder type as arguments. The Recipient is the owner of the mailbox, the
type would be a member of the OlDefaultFolders enum, in this case
olFolderInbox.

A selected item in the current folder view is
Application.ActiveExplorer.Selection[1]. You can test for
Application.ActiveExplorer.Selection.Count to see how many items are
selected. You can test for that item's Class property to make sure it's a
mail item. That would be OlObjectClass.olMail.

You have to explain what you mean by "As per my knowledge the archival file
might be in the exchange
server only.", that could be anywhere. Assuming you mean the archive folder
is in the Exchange public folders store just below the All Public Folders
location then you'd use something like this:

// ns is an instantiated NameSpace object
Outlook.MAPIFolder folder =
ns.GetDefaultFolder(Outlook.OlDefaultFolders.olPub licFoldersAllPublicFolders).Folders["Archive"];

You would then use the Move() function for the item to be archived to move
it to that archive folder.

You can then store the EntryID of the moved item for future reference, along
with the StoreID of the public folder to be able to retrieve it later using
NameSpace.GetItemFromID(). Or you can search the Items collection of the
archive folder using any property you want using either the Find() or
Restrict() methods of the Items collection, or you can do a brute force
search in the folder to match whatever property you are searching on.

For future reference you should always provide as much information as
possible, including the version or versions of Outlook you want to support.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Pradeep Yamujala" wrote in
message ...
Hi Ken,

In my client environment, they are using exchange server. In that
they created few shared inboxes. All the users has their own dedicated
mail
accounts. These shared inboxes attached to the dedicated mail accounts so
that when they login able to retrive these inboxes.

As per my knowledge the archival file might be in the exchange
server only. What my plugin must do is, what ever mail they selected must
go
in archives oncce he clicked on "Archive" button. Also I must search the
mails in archives also, if user wants he can retrive the same.

At this point i want to know how to pweform this archival
operation using VSTO 3.0 and C#. And also how to search in the archive
folder.

I hope this explains my doubt. Please help me to solve this problem.

Thanks
Pradeep Yamujala.
------------------------------------------------------------------------------------------




All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com