To move items into adxolSolutionFolder folder

Add-in Express™ Support Service
That's what is more important than anything else

To move items into adxolSolutionFolder folder
Move items into adxolSolutionFolder folder from Inbox folder 
gaurav mittal


Guest


Greetings,

I want to move items into adxolSolutionFolder of adxolSolutionModule from Inbox folder.
If there is any way to do this, please suggest on this point.

I am using "Add-in Express 2010 for Microsoft Office and .net, Standard" , v604-b3056 .
I intend to use this feature in outlook 2010 professional.




Thanks.....
Posted 21 Sep, 2011 04:18:56 Top
Eugene Astafiev


Guest


Hi Gaurav,

You can find the root solution folder in the same way as you do in case of a regular Outlook folder. For example, the following code works like a charm on my PC:

private void adxRibbonButton1_OnClick(object sender, IRibbonControl control, bool pressed)
{
    Outlook.NameSpace ns=  OutlookApp.GetNamespace("MAPI");
    Outlook.MAPIFolder folder = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
    Outlook.MAPIFolder parent = folder.Parent as Outlook.MAPIFolder;
    Outlook.Folders folders = parent.Folders;       
    for (int i = 1; i <= folders.Count; i++)
    {                
        Outlook.MAPIFolder subFolder = folders.Item(i) as Outlook.MAPIFolder;
        if (subFolder.Name == "adxolSolutionFolder1")
        {
            System.Windows.Forms.MessageBox.Show("Success!");
        }
        Marshal.ReleaseComObject(subFolder);
    }
    if (folders != null) Marshal.ReleaseComObject(folders);
    if (parent != null) Marshal.ReleaseComObject(parent);
    if (folder != null) Marshal.ReleaseComObject(folder);
    if (ns != null) Marshal.ReleaseComObject(ns);
}


After you have found the target folder you can use the Move method of Outlook items (for example, of the MailItem class in Outlook) to move the item into another folder.

FYI To get assistance with host applications?Â?Ð?é objects, their properties, and methods as well as help info, use the Object Browser. Go to the VBA environment (in the host application, choose menu Tools | Macro | Visual Basic Editor or just press {Alt+F11}), press {F2}, select the host application in the topmost combo and/or specify a search string in the search combo. Select a class /property /method and press {F1} to get the help topic that relates to the object.
Posted 21 Sep, 2011 08:34:45 Top