![]() |
OL 2007 - Set custom form region as default
I created a custom form region with the following message class:
"IPM.Contact.TestAddIn1.ClientRegion". I then created a new Folder within the default Contacts folder to store these custom items. Finally, I created a NavigationFolder within the Contacts navigation module which points to my new Folder. when I click the navigation pane folder it is raising the default Contacts form, rather than my custom form. this is expected. the problem is that I can't find a way to set my custom message class for this folder in order to correct this problem. The DefaultMessageClass property of my folder is read-only. Also when I first create my folder, the help file specifies that the additional optional parameter should specify an olDefaultFolder type, so I can't set it there either. any help appreciated as Ive been stuck on this now for a while :( |
OL 2007 - Set custom form region as default
Since form regions do not themselves have message classes, I'm a little confused both about what you've done and about what you're trying to do with the form region. Maybe you can post your region's manifest or at least explain whether you're trying to do an adjoining or separate region.
If you want users to use a custom form to create items in your folder, create and publish a traditional Outlook form with the desired message class and set it as the folder's default on the Properties dialog for the form. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Fidget Brain" wrote in message ... I created a custom form region with the following message class: "IPM.Contact.TestAddIn1.ClientRegion". I then created a new Folder within the default Contacts folder to store these custom items. Finally, I created a NavigationFolder within the Contacts navigation module which points to my new Folder. when I click the navigation pane folder it is raising the default Contacts form, rather than my custom form. this is expected. the problem is that I can't find a way to set my custom message class for this folder in order to correct this problem. The DefaultMessageClass property of my folder is read-only. Also when I first create my folder, the help file specifies that the additional optional parameter should specify an olDefaultFolder type, so I can't set it there either. any help appreciated as Ive been stuck on this now for a while :( |
OL 2007 - Set custom form region as default
You should be able to right click on the folder, select Properties and use
the "When posting to this folder" to select the region you want. You must have registered the region as a replace or replaceAll region, which is sounds like you did according to the message class. John "Sue Mosher [MVP-Outlook]" wrote: Since form regions do not themselves have message classes, I'm a little confused both about what you've done and about what you're trying to do with the form region. Maybe you can post your region's manifest or at least explain whether you're trying to do an adjoining or separate region. If you want users to use a custom form to create items in your folder, create and publish a traditional Outlook form with the desired message class and set it as the folder's default on the Properties dialog for the form. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Fidget Brain" wrote in message ... I created a custom form region with the following message class: "IPM.Contact.TestAddIn1.ClientRegion". I then created a new Folder within the default Contacts folder to store these custom items. Finally, I created a NavigationFolder within the Contacts navigation module which points to my new Folder. when I click the navigation pane folder it is raising the default Contacts form, rather than my custom form. this is expected. the problem is that I can't find a way to set my custom message class for this folder in order to correct this problem. The DefaultMessageClass property of my folder is read-only. Also when I first create my folder, the help file specifies that the additional optional parameter should specify an olDefaultFolder type, so I can't set it there either. any help appreciated as Ive been stuck on this now for a while :( |
OL 2007 - Set custom form region as default
please accept my aplogies if i did not explain myself well enough. i will
try again. i have created a .NET form region which has a formRegionType of 'separateAll'. my form region is an embedded resource. i can open it from the command bar with the following code and it works fine: const string clientsMessageClass = "IPM.Contact.TestAddin1.Client"; Outlook.ContactItem contactItem = (Outlook.ContactItem)clientsFolder.Items.Add(clien tsMessageClass); contactItem.MessageClass = clientsMessageClass; contactItem.Display(objMissing); now i am trying to create a new NavigationItem within the Contacts navigation pane to access this form region. So i am doing code like this, where 'clientFolder' is a MAPI Folder I have created within the default Contacts MAPI Folder as a place to store any custom items generated from my custom form: Outlook.NavigationFolder myCustomNavigationFolder = myCustomNavigationGroup.NavigationFolders.Add(clie ntsFolder); ok - so my problem is that whenever I double click my new NavigationItem it is opening the default contacts form. i want it to open my custom form region. "Sue Mosher [MVP-Outlook]" wrote in message ... Since form regions do not themselves have message classes, I'm a little confused both about what you've done and about what you're trying to do with the form region. Maybe you can post your region's manifest or at least explain whether you're trying to do an adjoining or separate region. If you want users to use a custom form to create items in your folder, create and publish a traditional Outlook form with the desired message class and set it as the folder's default on the Properties dialog for the form. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Fidget Brain" wrote in message ... I created a custom form region with the following message class: "IPM.Contact.TestAddIn1.ClientRegion". I then created a new Folder within the default Contacts folder to store these custom items. Finally, I created a NavigationFolder within the Contacts navigation module which points to my new Folder. when I click the navigation pane folder it is raising the default Contacts form, rather than my custom form. this is expected. the problem is that I can't find a way to set my custom message class for this folder in order to correct this problem. The DefaultMessageClass property of my folder is read-only. Also when I first create my folder, the help file specifies that the additional optional parameter should specify an olDefaultFolder type, so I can't set it there either. any help appreciated as Ive been stuck on this now for a while :( |
OL 2007 - Set custom form region as default
sorry i forgot to mention
manually right clicking the folder to achieve this is no good to me. this is a .NET add-in that will be shipped out to users, so i am asuming that I can do this programmatically. "Fidget Brain" wrote in message ... I created a custom form region with the following message class: "IPM.Contact.TestAddIn1.ClientRegion". I then created a new Folder within the default Contacts folder to store these custom items. Finally, I created a NavigationFolder within the Contacts navigation module which points to my new Folder. when I click the navigation pane folder it is raising the default Contacts form, rather than my custom form. this is expected. the problem is that I can't find a way to set my custom message class for this folder in order to correct this problem. The DefaultMessageClass property of my folder is read-only. Also when I first create my folder, the help file specifies that the additional optional parameter should specify an olDefaultFolder type, so I can't set it there either. any help appreciated as Ive been stuck on this now for a while :( |
OL 2007 - Set custom form region as default
You'll have to settle for doing it manually at present. There apparently is a bug in Beta 2 related to using PropertyAccessor to set folder properties. Otherwise, you'd be able to use something like (VBA prototype):
Sub SetDefaultFormFolder(fld As Outlook.Folder, _ formClass As String, formName As String) Dim pa As Outlook.PropertyAccessor Dim propNames() Dim propValues() Dim arrErrors() strPR_DEF_POST_MSGCLASS = _ "http://schemas.microsoft.com/mapi/proptag/0x36E5001E" strPR_DEF_POST_DISPLAYNAME = _ "http://schemas.microsoft.com/mapi/proptag/0x36E6001E" 'On Error Resume Next If Not fld Is Nothing Then propNames() = Array(strPR_DEF_POST_MSGCLASS, _ strPR_DEF_POST_DISPLAYNAME) propValues() = Array(formClass, formName) Set pa = fld.PropertyAccessor arrErrors = pa.SetProperties(propNames, propValues) If Not (IsEmpty(arrErrors)) Then 'Examine the arrErrors array to determine if any 'elements contain errors For i = LBound(arrErrors) To UBound(arrErrors) 'Examine the type of the element If IsError(arrErrors(i)) Then Debug.Print (CVErr(arrErrors(i))) End If Next End If End If Set pa = Nothing End Sub Alternatively, if your add-in creates the folder, then you could deploy it by including a .pst file as a project resource, with the folder in that file, already prepopulated with the desired properties. Your code would simply copy the folder to the user's existing folder hierarchy. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Fidget Brain" wrote in message ... sorry i forgot to mention manually right clicking the folder to achieve this is no good to me. this is a .NET add-in that will be shipped out to users, so i am asuming that I can do this programmatically. "Fidget Brain" wrote in message ... I created a custom form region with the following message class: "IPM.Contact.TestAddIn1.ClientRegion". I then created a new Folder within the default Contacts folder to store these custom items. Finally, I created a NavigationFolder within the Contacts navigation module which points to my new Folder. when I click the navigation pane folder it is raising the default Contacts form, rather than my custom form. this is expected. the problem is that I can't find a way to set my custom message class for this folder in order to correct this problem. The DefaultMessageClass property of my folder is read-only. Also when I first create my folder, the help file specifies that the additional optional parameter should specify an olDefaultFolder type, so I can't set it there either. any help appreciated as Ive been stuck on this now for a while :( |
OL 2007 - Set custom form region as default
Store properties from PropertyAccessor too. You have to exit and restart
Outlook before changes you make are readable in the OOM, although OutlookSpy sees them immediately. Something to do with caching properties I imagine. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Sue Mosher [MVP-Outlook]" wrote in message ... You'll have to settle for doing it manually at present. There apparently is a bug in Beta 2 related to using PropertyAccessor to set folder properties. Otherwise, you'd be able to use something like (VBA prototype): Sub SetDefaultFormFolder(fld As Outlook.Folder, _ formClass As String, formName As String) Dim pa As Outlook.PropertyAccessor Dim propNames() Dim propValues() Dim arrErrors() strPR_DEF_POST_MSGCLASS = _ "http://schemas.microsoft.com/mapi/proptag/0x36E5001E" strPR_DEF_POST_DISPLAYNAME = _ "http://schemas.microsoft.com/mapi/proptag/0x36E6001E" 'On Error Resume Next If Not fld Is Nothing Then propNames() = Array(strPR_DEF_POST_MSGCLASS, _ strPR_DEF_POST_DISPLAYNAME) propValues() = Array(formClass, formName) Set pa = fld.PropertyAccessor arrErrors = pa.SetProperties(propNames, propValues) If Not (IsEmpty(arrErrors)) Then 'Examine the arrErrors array to determine if any 'elements contain errors For i = LBound(arrErrors) To UBound(arrErrors) 'Examine the type of the element If IsError(arrErrors(i)) Then Debug.Print (CVErr(arrErrors(i))) End If Next End If End If Set pa = Nothing End Sub Alternatively, if your add-in creates the folder, then you could deploy it by including a .pst file as a project resource, with the folder in that file, already prepopulated with the desired properties. Your code would simply copy the folder to the user's existing folder hierarchy. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx |
OL 2007 - Set custom form region as default
i did not realise that certain MAPI properties would not be exposed in the
..NET model and that I would have to use the PropertyAcessor to get/set them. thanks for that info. I am new to MAPI and have had a cursory look through the documentation on MSDN. however i could see no reference to the schemas you mention to which define these properties e.g. "http://schemas.microsoft.com/mapi/proptag/0x36E5001E". is there a place which maps these schemas against the properties? thanks "Sue Mosher [MVP-Outlook]" wrote in message ... You'll have to settle for doing it manually at present. There apparently is a bug in Beta 2 related to using PropertyAccessor to set folder properties. Otherwise, you'd be able to use something like (VBA prototype): Sub SetDefaultFormFolder(fld As Outlook.Folder, _ formClass As String, formName As String) Dim pa As Outlook.PropertyAccessor Dim propNames() Dim propValues() Dim arrErrors() strPR_DEF_POST_MSGCLASS = _ "http://schemas.microsoft.com/mapi/proptag/0x36E5001E" strPR_DEF_POST_DISPLAYNAME = _ "http://schemas.microsoft.com/mapi/proptag/0x36E6001E" 'On Error Resume Next If Not fld Is Nothing Then propNames() = Array(strPR_DEF_POST_MSGCLASS, _ strPR_DEF_POST_DISPLAYNAME) propValues() = Array(formClass, formName) Set pa = fld.PropertyAccessor arrErrors = pa.SetProperties(propNames, propValues) If Not (IsEmpty(arrErrors)) Then 'Examine the arrErrors array to determine if any 'elements contain errors For i = LBound(arrErrors) To UBound(arrErrors) 'Examine the type of the element If IsError(arrErrors(i)) Then Debug.Print (CVErr(arrErrors(i))) End If Next End If End If Set pa = Nothing End Sub Alternatively, if your add-in creates the folder, then you could deploy it by including a .pst file as a project resource, with the folder in that file, already prepopulated with the desired properties. Your code would simply copy the folder to the user's existing folder hierarchy. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Fidget Brain" wrote in message ... sorry i forgot to mention manually right clicking the folder to achieve this is no good to me. this is a .NET add-in that will be shipped out to users, so i am asuming that I can do this programmatically. "Fidget Brain" wrote in message ... I created a custom form region with the following message class: "IPM.Contact.TestAddIn1.ClientRegion". I then created a new Folder within the default Contacts folder to store these custom items. Finally, I created a NavigationFolder within the Contacts navigation module which points to my new Folder. when I click the navigation pane folder it is raising the default Contacts form, rather than my custom form. this is expected. the problem is that I can't find a way to set my custom message class for this folder in order to correct this problem. The DefaultMessageClass property of my folder is read-only. Also when I first create my folder, the help file specifies that the additional optional parameter should specify an olDefaultFolder type, so I can't set it there either. any help appreciated as Ive been stuck on this now for a while :( |
OL 2007 - Set custom form region as default
The easiest way is to use Outlook Spy to look them up. MAPI Editor (mfcmapi.exe) is free and has similar features, but it's not as easy as OL Spy.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Fidget Brain" wrote in message ... i did not realise that certain MAPI properties would not be exposed in the .NET model and that I would have to use the PropertyAcessor to get/set them. thanks for that info. I am new to MAPI and have had a cursory look through the documentation on MSDN. however i could see no reference to the schemas you mention to which define these properties e.g. "http://schemas.microsoft.com/mapi/proptag/0x36E5001E". is there a place which maps these schemas against the properties? thanks "Sue Mosher [MVP-Outlook]" wrote in message ... You'll have to settle for doing it manually at present. There apparently is a bug in Beta 2 related to using PropertyAccessor to set folder properties. Otherwise, you'd be able to use something like (VBA prototype): Sub SetDefaultFormFolder(fld As Outlook.Folder, _ formClass As String, formName As String) Dim pa As Outlook.PropertyAccessor Dim propNames() Dim propValues() Dim arrErrors() strPR_DEF_POST_MSGCLASS = _ "http://schemas.microsoft.com/mapi/proptag/0x36E5001E" strPR_DEF_POST_DISPLAYNAME = _ "http://schemas.microsoft.com/mapi/proptag/0x36E6001E" 'On Error Resume Next If Not fld Is Nothing Then propNames() = Array(strPR_DEF_POST_MSGCLASS, _ strPR_DEF_POST_DISPLAYNAME) propValues() = Array(formClass, formName) Set pa = fld.PropertyAccessor arrErrors = pa.SetProperties(propNames, propValues) If Not (IsEmpty(arrErrors)) Then 'Examine the arrErrors array to determine if any 'elements contain errors For i = LBound(arrErrors) To UBound(arrErrors) 'Examine the type of the element If IsError(arrErrors(i)) Then Debug.Print (CVErr(arrErrors(i))) End If Next End If End If Set pa = Nothing End Sub Alternatively, if your add-in creates the folder, then you could deploy it by including a .pst file as a project resource, with the folder in that file, already prepopulated with the desired properties. Your code would simply copy the folder to the user's existing folder hierarchy. "Fidget Brain" wrote in message ... sorry i forgot to mention manually right clicking the folder to achieve this is no good to me. this is a .NET add-in that will be shipped out to users, so i am asuming that I can do this programmatically. "Fidget Brain" wrote in message ... I created a custom form region with the following message class: "IPM.Contact.TestAddIn1.ClientRegion". I then created a new Folder within the default Contacts folder to store these custom items. Finally, I created a NavigationFolder within the Contacts navigation module which points to my new Folder. when I click the navigation pane folder it is raising the default Contacts form, rather than my custom form. this is expected. the problem is that I can't find a way to set my custom message class for this folder in order to correct this problem. The DefaultMessageClass property of my folder is read-only. Also when I first create my folder, the help file specifies that the additional optional parameter should specify an olDefaultFolder type, so I can't set it there either. any help appreciated as Ive been stuck on this now for a while :( |
All times are GMT +1. The time now is 05:58 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-2006 OutlookBanter.com