View Single Post
  #7  
Old July 5th 06, 04:15 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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


Ads