PC Review


Reply
Thread Tools Rate Thread

How to archive mails using VSTO 3.0

 
 
Pradeep Yamujala
Guest
Posts: n/a
 
      5th Feb 2009
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.
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      5th Feb 2009
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" <(E-Mail Removed)> wrote in
message news:050A67BB-9347-4F45-A719-(E-Mail Removed)...
> 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.


 
Reply With Quote
 
Pradeep Yamujala
Guest
Posts: n/a
 
      6th Feb 2009
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" <(E-Mail Removed)> wrote in
> message news:050A67BB-9347-4F45-A719-(E-Mail Removed)...
> > 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.

>
>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      6th Feb 2009
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.olPublicFoldersAllPublicFolders).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" <(E-Mail Removed)> wrote in
message news:47F61EAF-B6EE-484E-9D1F-(E-Mail Removed)...
> 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.
> ------------------------------------------------------------------------------------------


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to categorize some mails as do not archive ? Ujas D Microsoft Outlook Discussion 2 12th Mar 2009 03:11 PM
Unable to Archive old mails =?Utf-8?B?SG93ZQ==?= Microsoft Outlook Discussion 2 24th Jan 2006 01:17 PM
Archive mails Ari Microsoft Outlook 2 22nd Feb 2005 04:41 PM
archive e-mails karen Microsoft Outlook Discussion 4 12th Mar 2004 10:57 PM
Archive of old e-mails Larry Fendrich Microsoft Outlook Discussion 1 17th Feb 2004 11:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:54 AM.