open form region of contact card as the first screen when open contact card through vsto RRS feed

  • Question

  • Hi,

    I created some custom form regions of class IPM.Contact at outlook 2007 Addin by using vsto,C#, well these form region tags/label are showing at Show ribbon of contact card, and I'm able to go on them by clicking these labels.

    Well now our next requirement is that when click on contact , by default it goes to that custom form region instead of showing General page of contact card.

    for check purpose I put the code at some button click event  as


               Outlook.Application olApp = new Outlook.Application();
                Outlook.MAPIFolder contactsFolder = olApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
                Outlook.Items contacts;
                // contacts = contactsFolder.Items.Restrict("[MessageClass]='IPM.Contact'");
                contacts = contactsFolder.Items;
                Outlook.ContactItem existingContact = (Outlook.ContactItem)contacts.Find("[CustomerID] = '652'");
                if (existingContact != null)
                        existingContact.GetInspector.SetCurrentFormPage("Referrals");  //  where Referrals is name of the form region , and I tried also

                        //existingContact.GetInspector.SetCurrentFormPage("RelationAddin.Referrals"); where RelationAddin is namespace as well as

                        //project name also
                    catch (System.Exception e11)

                    MessageBox.Show("The contact does not exist in the contacts list.");


    it is giving exception on the first line where we use SetCurrentPage that

    "the specified page does not exist or does not allow that operation "


    Any idea, I've searched other forums, some are saying that this code should work.

    The FormRegion class is partial like this

    namespace RelationAddin
       partial class Referrals

    well if I make it public then its designer.cs file get conflicts


    Please try to reply asap, I've to implement same requirement in ol2010 also.







    Tuesday, April 5, 2011 12:07 PM


  • Hello Mehnaz13,


    Thanks for posting in the MSDN Forum.


    As far as I see we’re not able to use “SetCurrentFormPage” due to the form regions can’t be a part of modify form page.


    If I have misunderstood anything, please feel free to let me know.


    Have a good day,



    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Mehnaz13 Thursday, April 7, 2011 11:35 AM
    Thursday, April 7, 2011 7:37 AM