R
Rolando Tonin
I’m developing an Outlook2007
AddIn in C# with Visual Studio 2008 and VSTO 3.0.
I create an .pst file with this code:
this.DefaultNameSpace.AddStoreEx(@"C:\DATI\IDROESSE\IDROESSE.PST",
OlStoreType.olStoreDefault);
Now I want to change the default displayName "Personal Folder" (Italian
speak: "Cartelle Personali") with my company name. First I get the object
store:
private Store CheckStore(string storePath)
{
foreach (Store obj in this.DefaultNameSpace.Stores)
{
if (obj.FilePath == storePath)
return obj;
}
return null;
}
and, conseguently, add this code after create .pst file:
this.DefaultNameSpace.AddStoreEx(@"C:\DATI\IDROESSE\IDROESSE.PST",
OlStoreType.olStoreDefault);
Store sto = this.CheckStore(@"C:\DATI\IDROESSE\IDROESSE.PST");
if (sto != null)
sto.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x3001001E", "Idroesse");
the call to SetProperty generate an UnauthorizedAccessException. The
permission on the path C:\DATI\IDROESSE\ is full control for each Domain
Users. Why I get an Exception? How can I resolve the problem?
thanks in advance
Rolando Tonin
AddIn in C# with Visual Studio 2008 and VSTO 3.0.
I create an .pst file with this code:
this.DefaultNameSpace.AddStoreEx(@"C:\DATI\IDROESSE\IDROESSE.PST",
OlStoreType.olStoreDefault);
Now I want to change the default displayName "Personal Folder" (Italian
speak: "Cartelle Personali") with my company name. First I get the object
store:
private Store CheckStore(string storePath)
{
foreach (Store obj in this.DefaultNameSpace.Stores)
{
if (obj.FilePath == storePath)
return obj;
}
return null;
}
and, conseguently, add this code after create .pst file:
this.DefaultNameSpace.AddStoreEx(@"C:\DATI\IDROESSE\IDROESSE.PST",
OlStoreType.olStoreDefault);
Store sto = this.CheckStore(@"C:\DATI\IDROESSE\IDROESSE.PST");
if (sto != null)
sto.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x3001001E", "Idroesse");
the call to SetProperty generate an UnauthorizedAccessException. The
permission on the path C:\DATI\IDROESSE\ is full control for each Domain
Users. Why I get an Exception? How can I resolve the problem?
thanks in advance
Rolando Tonin