本文整理汇总了C#中Microsoft.Office.Interop.Outlook.GetFolderFromID方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Office.Interop.Outlook.GetFolderFromID方法的具体用法?C# Microsoft.Office.Interop.Outlook.GetFolderFromID怎么用?C# Microsoft.Office.Interop.Outlook.GetFolderFromID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Office.Interop.Outlook
的用法示例。
在下文中一共展示了Microsoft.Office.Interop.Outlook.GetFolderFromID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryGetCompanyOutlookFolder
public static Outlook.MAPIFolder TryGetCompanyOutlookFolder(Guid companyID, BrugerInfo brugerInfo, Outlook.NameSpace sessionNamespace)
{
using (var _dc = new iorunEntities())
{
var kunde = _dc.Kunder.Where(k => k.Kunde_GUID == companyID).ToList().Single();
var userSettings = _dc.UserSettings.Where(us => us.US_UserGUID == brugerInfo.ID).ToList().Single();
var companyArchiveFolderEntryID = kunde.Kunde_EntryID;
var companyArchiveFolderStoreID = kunde.Kunde_StoreID;
var rootArchiveFolderStoreID = userSettings.US_ExchangeStore;
var rootArchiveFolderEntryID = userSettings.US_ExchangeEntry;
var companyFolderName = kunde.Kunde_Navn_1.Trim();
var folderLetter = companyFolderName[0];
var rootArchiveFolder = sessionNamespace.GetFolderFromID(rootArchiveFolderEntryID, rootArchiveFolderStoreID);
if (rootArchiveFolder == null)
{
throw new ApplicationException("Failed to get root folder for archive");
}
var letterFolder = GetSubFolderByName(rootArchiveFolder, folderLetter.ToString());
if (letterFolder == null)
{
letterFolder = rootArchiveFolder.Folders.Add(folderLetter.ToString());
}
var companyFolder = GetSubFolderByName(letterFolder, companyFolderName);
if (companyFolder == null)
{
try
{
companyFolder = letterFolder.Folders.Add(companyFolderName);
}
catch (COMException comException)
{
log.Error(comException);
MessageBox.Show(string.Format("Du har ikke rettighed til at tilgå eller oprette mappen\n\nFejlen var: {0}", comException.Message), "Adgang nægtet", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
return companyFolder;
}
}
开发者ID:NephelimDK,项目名称:IOfficeConnect,代码行数:46,代码来源:IOfficeConnectGlobals+(TERMINAL01s+modstridende+kopi+2015-05-07).cs
示例2: ArchiveRootFolderExists
public static bool ArchiveRootFolderExists(Outlook.NameSpace sessionNamespace, BrugerInfo brugerInfo)
{
using (var _dc = new iorunEntities())
{
var userSettings = _dc.UserSettings.Where(us => us.US_UserGUID == brugerInfo.ID).ToList().Single();
var rootArchiveFolderStoreID = userSettings.US_ExchangeStore;
var rootArchiveFolderEntryID = userSettings.US_ExchangeEntry;
try
{
var rootArchiveFolder = sessionNamespace.GetFolderFromID(rootArchiveFolderEntryID, rootArchiveFolderStoreID);
if (rootArchiveFolder == null)
{
return false;
}
return true;
}
catch (COMException ce)
{
log.Info(string.Format("ArchiveRootFolderExists: Findes ikke. COM fejl: {0}", ce.Message), ce);
return false;
}
}
}