How do I change the display name of a .pst store

Status
Not open for further replies.
E

escamoteur

Hi,

I tried to change the display name of a newly added .pst store

theApp.Instance.Application.Session.AddStoreEx(path,Microsoft.Office.Interop.Outlook.OlStoreType.olStoreUnicode); //Find Our Store with WorkAround over FilePath Outlook.Stores stores=theApp.Instance.Application.Session.Stores; foreach (Outlook.Store store in stores) { if (store.FilePath== path) { AO_Store = store; string PR_DISPLAY_NAME=@"http://schemas.microsoft.com/mapi/proptag/0x3001001F"; Outlook.PropertyAccessor oPA=store.PropertyAccessor; try { oPA.SetProperty(PR_DISPLAY_NAME,"ArtistsOrganizer"); } catch (Exception e) { Debug.WriteLine(e.Message); } } }But I get an access denied exception when I run this.All the bestTom
 
E

escamoteur

I tried to change the display name of a newly added .pst store

theApp.Instance.Application.Session.AddStoreEx(path,Microsoft.Office.Interop.Outlook.OlStoreType.olStoreUnicode);

//Find Our Store with WorkAround over FilePath

Outlook.Stores stores=theApp.Instance.Application.Session.Stores;

foreach (Outlook.Store store in stores)

{

if (store.FilePath== path)

{

AO_Store = store;

string PR_DISPLAY_NAME=@"http://schemas.microsoft.com/mapi/proptag/0x3001001F";

Outlook.PropertyAccessor oPA=store.PropertyAccessor;

try

{

oPA.SetProperty(PR_DISPLAY_NAME,"ArtistsOrganizer");

}

catch (Exception e)

{

Debug.WriteLine(e.Message);

}

}

}

But I get an access denied exception when I run this.

All the bestTom
 
K

Ken Slovak - [MVP - Outlook]

It looks like you can't set that property using the PropertyAccessor object.

When MS added that way of accessing properties not exposed in the object

model some were restricted for read or write access. The explanation is that

those restricted properties are important to the business logic of Outlook

and so aren't available to the user for unrestricted access.

It looks like PR_DISPLAY_NAME on a Store is one of those properties. I

verified the problem using both the Unicode property tag you used as well as

the ANSI equivalent (ending in 0x1E instead of in 0x1F) and write access was

restricted in both cases. Read access works.

I was able to change the property value using OutlookSpy, so that means that

if you use Extended MAPI or another API such as Redemption

(www.dimastr.com/redemption) or even CDO 1.21 you would be able to change

that property value.

"escamoteur" <mail@burkharts.net> wrote in message

news:466A3D85-C526-489D-AA4F-662ED7CF413C@microsoft.com...
> I tried to change the display name of a newly added .pst store

> theApp.Instance.Application.Session.AddStoreEx(path,Microsoft.Office.Interop.Outlook.OlStoreType.olStoreUnicode);
> //Find Our Store with WorkAround over FilePath
> Outlook.Stores stores=theApp.Instance.Application.Session.Stores;
> foreach (Outlook.Store store in stores)
> {
> if (store.FilePath== path)
> {
> AO_Store = store;
> string
> PR_DISPLAY_NAME=@"http://schemas.microsoft.com/mapi/proptag/0x3001001F";
> Outlook.PropertyAccessor oPA=store.PropertyAccessor; try
> {

> oPA.SetProperty(PR_DISPLAY_NAME,"ArtistsOrganizer"); }
> catch (Exception e)
> {
> Debug.WriteLine(e.Message);
> }
> }
> }

> But I get an access denied exception when I run this.

> All the bestTom
 
B

Brian Tillman

"escamoteur" <mail@burkharts.net> wrote in message

news:466A3D85-C526-489D-AA4F-662ED7CF413C@microsoft.com...


> I tried to change the display name of a newly added .pst store


Seems easier to me to just change it with the Outlook UI.

--
 
E

escamoteur

The point is, that my Add-In should initialize it's folder structure automatically at the first Start. So Asking the user to change

the Name is a bit way out

"Brian Tillman " <tillman1952@yahoo.com> schrieb im Newsbeitrag news:Obmhn14DKHA.4064@TK2MSFTNGP04.phx.gbl...
> "escamoteur" <mail@burkharts.net> wrote in message news:466A3D85-C526-489D-AA4F-662ED7CF413C@microsoft.com...
>
> >I tried to change the display name of a newly added .pst store


> Seems easier to me to just change it with the Outlook UI.
> >
 
E

escamoteur

Hi,

I just found Out, that if you only want to change the name, the user sees in Outlook for the new store, it's enough just to change

the "Name" of the Defaultfolder of the store.

Outlook.MAPIFolder rootFolder = (Outlook.Folder) AO_Store.GetRootFolder();

rootFolder.Name = "ArtistsOrganizer";

Tom
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Fozzie Bear Change the Display Name recipients see for Exchange account Exchange Server Administration 0
E How do I change the display name of a .pst store Outlook VBA and Custom Forms 5
E How to display "Change Folder" in Change Default Email Delivery Location in Exchange Outlook 2016 Using Outlook 1
Maybear Sudden change in Outlook, no image display, email no longer offers suggestions for address Using Outlook 8
K Change default "Display As" for contact email addresses Using Outlook 1
M how to change outlook calendar time display Using Outlook 5
M Default settings for "Display as" Change? Outlook VBA and Custom Forms 8
witzker Pls help to change the code for inserting date in Ol contact body Outlook VBA and Custom Forms 5
R How to Change Margins In Google Docs...? New Slipstick.com Articles 0
e_a_g_l_e_p_i Outlook 2010 How can I change the font size on right side appointment pane Using Outlook 12
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1
B Change Font and Font size using VBA Outlook VBA and Custom Forms 9
D Change senders title Using Outlook 1
W Recurrence: delete older occurrences / change earliest start time Outlook VBA and Custom Forms 0
E Change sending account depending on Subjectline Outlook VBA and Custom Forms 0
J Outlook 2013 Change color of text in data fields of contacts in Outlook 2013? Using Outlook 9
B Change row background color of selected item Using Outlook 1
PGSystemTester VBA To Change AppointmentItem.BusyStatus From MeetingItem Before Send Using Outlook 0
B Change from Address Outlook VBA and Custom Forms 0
X If you change expiration date of repeated task it dupplicates Using Outlook 1
B See "Change View" Drop Down as a List? Using Outlook 1
V Change start time based on message duration Outlook VBA and Custom Forms 2
R Folder pane width change Using Outlook 59
S Change VBA script to send HTML email instead of text Outlook VBA and Custom Forms 3
S Outlook 2010 unable to change default font Using Outlook 7
P How can I change my calendar view back Using Outlook 3
A Edit subject - and change conversationTopic - using VBA and redemption Outlook VBA and Custom Forms 2
T Change the selected Message in the Outlook window Outlook VBA and Custom Forms 2
geofferyh How to change the Attachment File Name? Outlook VBA and Custom Forms 1
W Appointment occurrences change the location property Using Outlook 0
T Scheduled footer change Using Outlook 2
B Change font of reminder of an email header Outlook VBA and Custom Forms 3
CWM030 Name Change? Exchange Server Administration 9
V not able to change name in customize Ribbon Outlook VBA and Custom Forms 1
JoeG Appointment Delete/Change Recurrence Outlook VBA and Custom Forms 0
C Change Subject Line in Selected Emails Outlook VBA and Custom Forms 1
V Change default default save location to Quick Access Using Outlook 1
C Change default "Save Sent Item To" folder Outlook VBA and Custom Forms 9
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
B Do not change the From address in Outlook Templates Using Outlook 0
M Sudden change in From field - now very short Using Outlook 4
M cannot change delivery folders with IMAP accounts Using Outlook 0
S Email Format With Embedded Images and Tables Change Using Outlook 2
O On click,I want to change subject line of selected mail and then reply to particular email and move Using Outlook 3
P Change PC User Directory & iPhone Sync Using Outlook 2
A Change order of actions in one (!) rule Outlook VBA and Custom Forms 2
I change subject and forward without FW: Outlook VBA and Custom Forms 4
Rupert Dragwater Can't change font size Using Outlook 5
M VBA to change flag status in outlook contact item Outlook VBA and Custom Forms 3
J Auto Forward - Include Attachment and change Subject depending on original sender Outlook VBA and Custom Forms 3

Similar threads

Top