Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Interop / October 2004

Tip: Looking for answers? Try searching our database.

PropertyPage Added but no "Apply" Callback

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J?rg-Ulrich W?lfel - 12 Oct 2004 11:43 GMT
I successfully add a PropertyPage to the Options Dialog from within an
Outlook Addin written in C#.

But the "Apply"-Method of my UserControl implementing the
"PropertyPage"-Interface is not called.

I guess that I have to call the "OnStatusChanged" method of the
"PropertyPageSite". But I do not know how to get that PropertyPageSite from
my C# Code.

Thank you
J?rg
Sunny - 13 Oct 2004 23:20 GMT
Hi,

> I successfully add a PropertyPage to the Options Dialog from within an
> Outlook Addin written in C#.
[quoted text clipped - 8 lines]
> Thank you
> J?rg

you have to use reflection to get it, as this is unsafe private field
for the user controls.

Note that this is not supported, and it may break if there are some
changes in the implementation of window forms in some of the next
versions of the framework. It is nice that it works with SP1 :)

Here is my code. Put it in the Load event handler of your control:

string strAssembly = Type.GetType
("System.Object").Assembly.CodeBase.Replace
("mscorlib.dll","System.Windows.Forms.dll");

strAssembly = strAssembly.Replace("file:///", String.Empty);
strAssembly = System.Reflection.AssemblyName.GetAssemblyName
(strAssembly).FullName;

Type unmt = Type.GetType(System.Reflection.Assembly.CreateQualifiedName
(strAssembly, "System.Windows.Forms.UnsafeNativeMethods"));

Type ioot = unmt.GetNestedType("IOleObject");
System.Reflection.MethodInfo mi = ioot.GetMethod("GetClientSite");
object mySite = mi.Invoke(this, null);
try
{
    this.myPapa = (Outlook.PropertyPageSite)mySite;
}
catch (System.Exception ee)
{
    Base.WarnMessage(ee.ToString());
}

Cheers
Sunny

P.S. If you succeed to hook a help to all this, please, post how, I
still can not.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.