3
Answers

Need to add the folder in the registry with C# programming

faraz akram

faraz akram

15y
8.7k
1


Hi

 i want a piece of code  to create these 2 folders in Outlook
 
Options and the Mail Folder in Options
 
[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options]
 
[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options\Mail]
"AllowTNEFtoCreateProps"=dword:00000000
"AllowMSGFilestoCreateProps"=dword:00000001

Answers (3)
0
Roei Bar
NA 7.8k 0 15y

enjoy

class Program
{
static void Main(string[] args)
{
Microsoft.Win32.
RegistryKey subKey =
Microsoft.Win32.
Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office");
if (checkIfKeyExists(subKey))
{
subKey =
Microsoft.Win32.
Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\11.0");
if (checkIfKeyExists(subKey))
{
subKey =
Microsoft.Win32.
Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\11.0\\Outlook\\Options");
if (!checkIfKeyExists(subKey))
{
Microsoft.Win32.
Registry.LocalMachine.CreateSubKey("Software\\Microsoft\\Office\\11.0\\Outlook\\Options");
}
subKey =
Microsoft.Win32.
Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\11.0\\Outlook\\Options\\Mail");
if (!checkIfKeyExists(subKey))
{
Microsoft.Win32.
Registry.LocalMachine.CreateSubKey("Software\\Microsoft\\Office\\11.0\\Outlook\\Options\\Mail");
}
 
Microsoft.Win32.
Registry.LocalMachine.SetValue("AllowTNEFtoCreateProps", "00000000", RegistryValueKind.DWord);
Microsoft.Win32.
Registry.LocalMachine.SetValue("AllowMSGFilestoCreateProps", "00000001", RegistryValueKind.DWord);
}
}
}
private static bool checkIfKeyExists(Microsoft.Win32.RegistryKey subKey)
{
bool status = true;
if (subKey == null)
{
status =
false;
}
return status;
}
}
Accepted
0
faraz akram
NA 154 0 15y
I have a requirement of following data representation on 1 page on a rdlc report SR# Part# SR# Part# 1 ## 51 ## 2 ## 52 ## . ## . ## . ## . ## 50 ## 100 ## i can easily manage if their is only one table of data but as per above requirement one page must contains atleast 100 rows, 50 on left hand side and 50 on right hand side any help regading this thanx in advance
0
faraz akram
NA 154 0 15y
thanks a tons it really works .... :))