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.