Stuart Murray
Posts: 26
Joined: 2006-09-14
|
I see from a previous posting that you can bind to forms using a path of the type:
"Mailbox - Ron\Contacts\Business\Companies"
The problem with this is that each users mailbox is named differently, so freds mailbox will be:
"Mailbox - Fred\Contacts\Business\Companies"
What I need to be able to do is bind to a relative folder something like:
$CONTACTS$\Business\Companies
Any idea how to achieve this? Alternatively if I have to do it on the fly,how do I do it? |
|
Stuart Murray
Posts: 26
Joined: 2006-09-14
|
Aha,
I appear to have solved it. Basically you need to overload the AddinStartupComplete event and get the default folder programatically. My handler looks like:
private void AddinModule_AddinStartupComplete(object sender, EventArgs e)
{
// Now figure out the 'named' folders people user
String inbox = this.OutlookApp.Session.
GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox).
FolderPath;
String prefix="\\";
if (inbox.StartsWith(prefix))
{
inbox = inbox.Trim(prefix.ToCharArray());
}
String candidateFolder = inbox + "\Candidates";
this.adxExpCandidates_cb.FolderName = candidateFolder;
}
|
|
Sergey Grischenko
Add-in Express team
Posts: 7235
Joined: 2004-07-05
|
|