Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Found the solution. The only caveat is that I need to purchase <a href="http://www.add-in-express.com/outlook-regions/index.php" rel="nofollow noreferrer">Advanced Outlook regions for VSTO</a> and it cost me 100 dollars. If you purchase that product this is how you do it:</p> <p><strong>1. Create a new project on vistual studio of type (Outlook 2010 Add-in) I named my project <code>OutlookAddIn1</code></strong></p> <p><strong>2. Add a new item to the project (Product that I needed to purchase)</strong> <img src="https://i.stack.imgur.com/LTl0f.png" alt="enter image description here"></p> <p><strong>3. When you select that item a wizard shows up select the following options:</strong> <img src="https://i.stack.imgur.com/6R8hM.png" alt="enter image description here"></p> <p><strong>4. Follow all the defaults until the wizard finishes (click next, next etc. finish)</strong></p> <p><strong>5. There you have a windows forms. In order to place WPF content you will need to add a <code>ElementHost</code> controls. There are a log of tutorials on how to host a wpf usercontrol on windows forms. To keep this answer not that long I will not show how.</strong></p> <p><strong>6. For demo of this answer I will just place a button on that form:</strong> <img src="https://i.stack.imgur.com/RuHqr.png" alt="enter image description here"></p> <p><strong>7. with the press of that button I will hide that form and show the deffault view of the folder. So here is the code behind of that button:</strong></p> <pre><code> private void button1_Click(object sender, EventArgs e) { // disable the form that id does not show up Globals.ThisAddIn.ADXOlForm1Item.Enabled = false; // get the current selected folder var thisFOlder = Globals.ThisAddIn.Application.ActiveExplorer().CurrentFolder; // remove the webview pane in order to show the main folder view instead thisFOlder.WebViewOn = false; thisFOlder.WebViewURL = string.Empty; // RESET FOLDER BY SELECTING A DIFFERENT ONE THEN THE SAME ONE NameSpace nameSpace = Globals.ThisAddIn.Application.GetNamespace("MAPI"); MAPIFolder outboxFolder = nameSpace.GetDefaultFolder(OlDefaultFolders.olFolderOutbox); Globals.ThisAddIn.Application.ActiveExplorer().CurrentFolder = outboxFolder; // CHANGE FOLDER TO A DIFFERNT ONE System.Windows.Forms.Application.DoEvents(); Globals.ThisAddIn.Application.ActiveExplorer().CurrentFolder = thisFOlder; // SET INBOX AGAIN // remeember to release objects Marshal.ReleaseComObject(nameSpace); Marshal.ReleaseComObject(outboxFolder); Marshal.ReleaseComObject(thisFOlder); this.Close(); } </code></pre> <p><strong>8. When I then run that project note when I see when selecting any folder of type Mail:</strong> <img src="https://i.stack.imgur.com/daNTW.png" alt="enter image description here"></p> <p><strong>9. If I press that button I will then show the default view of the folder I had selected</strong></p> <p>The only probelm that I have now is that the view shows for every folder of type MailItem. You could select a different folder type on the first wizzard something that is not that common like Jurnal. Then on code behind you can select a jurnal folder for that form to show up. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload