如何检查当前用户配置的outlook
how to check outlook is configured for current user
我想检查给定机器上是否安装了 outlook 并为当前用户配置了 outlook。我正在使用以下代码...
private static bool IsOutlookProfileConfigured2()
{
try
{
RegistryKey currentUser = Registry.CurrentUser;
RegistryKey regWMSprofile = currentUser.OpenSubKey
(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles");
if (regWMSprofile == null)
{
regWMSprofile = currentUser.OpenSubKey
(@"Software\Microsoft\Office.0\Outlook\Profiles");
if (regWMSprofile == null)
{
return false;
}
Console.WriteLine(@"Found on path==>Software\Microsoft\Office.0\Outlook\Profiles");
}
else
{
Console.WriteLine(@"Found on path==>SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles");
}
Outlook.Application OlApplication = new Outlook.Application();
if (regWMSprofile.SubKeyCount > 0)
{
if (OlApplication == null)
{
return false;
}
Outlook.NameSpace olNameSpace =
OlApplication.GetNamespace("MAPI");
if (olNameSpace != null && olNameSpace.Accounts !=
null && olNameSpace.Accounts.Count > 0)
{
return true;
}
}
else
{
return false;
}
}
catch (Exception ex)
{
return false;
}
return false;
}
方法是说 outlook 配置文件位于 "Software\Microsoft\Office.0\Outlook\Profiles"。
Outlook 2013 已安装在用户计算机上但未配置。
因此此方法会打开 outlook 配置文件配置向导。
任何人都可以帮助我修复此功能或一些示例代码来检查是否为当前用户配置了 outlook 并且不应启动配置文件配置向导。
提前致谢。
If you find any folder inside this 'Profiles' folder, then the Outlook
is configured for the current user.
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows
Messaging Subsystem\Profiles
检查 link:- How to detect whether Outlook is configured on machine using Regis
我想检查给定机器上是否安装了 outlook 并为当前用户配置了 outlook。我正在使用以下代码...
private static bool IsOutlookProfileConfigured2()
{
try
{
RegistryKey currentUser = Registry.CurrentUser;
RegistryKey regWMSprofile = currentUser.OpenSubKey
(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles");
if (regWMSprofile == null)
{
regWMSprofile = currentUser.OpenSubKey
(@"Software\Microsoft\Office.0\Outlook\Profiles");
if (regWMSprofile == null)
{
return false;
}
Console.WriteLine(@"Found on path==>Software\Microsoft\Office.0\Outlook\Profiles");
}
else
{
Console.WriteLine(@"Found on path==>SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles");
}
Outlook.Application OlApplication = new Outlook.Application();
if (regWMSprofile.SubKeyCount > 0)
{
if (OlApplication == null)
{
return false;
}
Outlook.NameSpace olNameSpace =
OlApplication.GetNamespace("MAPI");
if (olNameSpace != null && olNameSpace.Accounts !=
null && olNameSpace.Accounts.Count > 0)
{
return true;
}
}
else
{
return false;
}
}
catch (Exception ex)
{
return false;
}
return false;
}
方法是说 outlook 配置文件位于 "Software\Microsoft\Office.0\Outlook\Profiles"。
Outlook 2013 已安装在用户计算机上但未配置。
因此此方法会打开 outlook 配置文件配置向导。
任何人都可以帮助我修复此功能或一些示例代码来检查是否为当前用户配置了 outlook 并且不应启动配置文件配置向导。
提前致谢。
If you find any folder inside this 'Profiles' folder, then the Outlook is configured for the current user.
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows
Messaging Subsystem\Profiles
检查 link:- How to detect whether Outlook is configured on machine using Regis