View Single Post
  #2  
Old January 15th 07, 04:50 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Property pages in OL 2007 addin

It's the same old object model for property pages. This looks like it's a C#
addin?

In my user control for the property pages I have this:

[DispID(-518)]
public string Caption
{
// m_caption has the caption
get { return m_caption; }
set { m_caption = value; }
}

In my property page event handler in ThisAddin I have this (example for
Tools, Options property page):

private void m_objOutlook_OptionsPagesAdd(Outlook.PropertyPages Pages)
{
ToolsOptionsPP oPP = new ToolsOptionsPP(); //the user control
string caption = "Whatever caption you want";

oPP.Caption = caption;
Pages.Add(oPP, caption);

oPP = null;
}

That's it. Nothing fancy.

One other thing, did you set the
[System.Runtime.InteropServices.ComVisibleAttribute (true)] attribute for the
user control class? It would look like this:

[System.Runtime.InteropServices.ComVisibleAttribute (true)]
public partial class ToolsOptionsPP : UserControl
{

I'd probably use the program_addins or program_vba groups as more
appropriate, BTW. Program_vba has become a catch-all and isn't only VBA
stuff any longer.

--
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


"Scott" wrote in message
...
Sorry that this isn't quite the right newsgroup, but it's the best place I
could find to post.

When developing an add-in using VSTO 2005 SE to make an Outlook 2007
add-in,
is there a new model for property pages? I've implemented the
Outlook.PropertyPage stuff on a UserControl, and have the [DispId(-518)]
attribute set on my PageCaption property getter, but when I go into
Tools-Options I don't see my property page.


Ads