A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 28th 09, 08:44 AM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.interop,microsoft.public.outlook.program_addins,microsoft.public.outlook.program_vba,microsoft.public.platformsdk.mapi
escamoteur
external usenet poster
 
Posts: 147
Default How do I change the display name of a .pst store

Hi,

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

theApp.Instance.Application.Session.AddStoreEx(pat h,Microsoft.Office.Interop.Outlook.OlStoreType.olS toreUnicode); //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 /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
Ads
  #2  
Old July 28th 09, 09:27 AM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.interop,microsoft.public.outlook.program_addins,microsoft.public.outlook.program_vba,microsoft.public.platformsdk.mapi
escamoteur
external usenet poster
 
Posts: 147
Default How do I change the display name of a .pst store

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

theApp.Instance.Application.Session.AddStoreEx(pat h,Microsoft.Office.Interop.Outlook.OlStoreType.olS toreUnicode);
//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 /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
  #3  
Old July 28th 09, 02:01 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.interop,microsoft.public.outlook.program_addins,microsoft.public.outlook.program_vba,microsoft.public.platformsdk.mapi
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How do I change the display name of a .pst store

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"escamoteur" wrote in message
...
I tried to change the display name of a newly added .pst store

theApp.Instance.Application.Session.AddStoreEx(pat h,Microsoft.Office.Interop.Outlook.OlStoreType.olS toreUnicode);
//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
/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


  #4  
Old July 28th 09, 03:12 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.interop,microsoft.public.outlook.program_addins,microsoft.public.outlook.program_vba,microsoft.public.platformsdk.mapi
Brian Tillman [MVP - Outlook]
external usenet poster
 
Posts: 4,874
Default How do I change the display name of a .pst store

"escamoteur" wrote in message
...

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.
--
Brian Tillman [MVP-Outlook]

  #5  
Old July 28th 09, 03:41 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.interop,microsoft.public.outlook.program_addins,microsoft.public.outlook.program_vba,microsoft.public.platformsdk.mapi
escamoteur
external usenet poster
 
Posts: 147
Default How do I change the display name of a .pst store

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 [MVP - Outlook]" schrieb im Newsbeitrag ...
"escamoteur" wrote in message ...

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.
--
Brian Tillman [MVP-Outlook]


  #6  
Old July 29th 09, 10:00 AM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.interop,microsoft.public.outlook.program_addins,microsoft.public.outlook.program_vba,microsoft.public.platformsdk.mapi
escamoteur
external usenet poster
 
Posts: 147
Default How do I change the display name of a .pst store

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

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change the display name of a .pst store escamoteur Outlook and VBA 5 July 29th 09 10:00 AM
reinstalled OL- cannot change store or get previous store up MikeR-Oz Outlook - General Queries 8 May 19th 08 01:19 PM
Change Store Folder Spark Outlook Express 6 January 27th 07 12:05 PM
calendar items store but do not display dmcruickshanks Outlook - Calandaring 0 July 19th 06 11:45 AM
Need codes for change the default delivery store [email protected] Outlook and VBA 3 May 3rd 06 07:28 AM


All times are GMT +1. The time now is 08:27 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.