PropertyPage causes install to fail


B

Ben M

I have a problem with an Outlook Addin I am building with a custom
PropertyPage, using C# and a version of the Outlook Library generated from
the Outlook 9 TLB.

The addin compiles and runs just fine on my development PC, but as soon as I
attempt to install it on any other PC (having a few different versions both
of Windows and Outlook), the Addin no longer loads. It installs fine, but it
doesn't join the list of COMAddins in Outlook. This behaviour only occurs
when I include a class in my code which:

1) Inherits from an Outlook object (e.g. PropertyPage, MAPIFolder)

2) Accepts an Outlook object as a parameter to its constructor

I can work around 2), but if I can't do 1), then I can't create a custom
property page, and that will be most disappointing!

The behaviour certainly doesn't happen in all cases when I use Outlook
objects, either - just in cases 1) and 2).

If anybody can suggest what I could do to avert this problem, I'd be really
grateful.
Cheers,
Ben
 
Ad

Advertisements

K

Ken Slovak - [MVP - Outlook]

Are you trying to create an Outlook object in your property page? That can
cause problems. If that's what you are trying to do then use
PropertyPageSite.Parent to get your Outlook Application object.
 
B

Ben M

Thanks for the reply, Ken,
In this case, I'm just inheriting from PropertyPage as I understand that I
am supposed to, to create a class of
my own called AccountPropPage. The minute I declare the inheritance, the
addin won't load on any machines
other than my development machine, so:

public class AccountPropPage : Outlook.PropertyPage { ... etc.

causes my addin not to load (installs fine, doesn't load), whereas

public class AccountPropPage { ... etc., no other changes

gives no problems (but I can't use the class as a property page)

I'm using msoutl9.olb as transformed for .Net by VS.Net. I also manually
edited the resulting DLL
to fix a known bug in event handling, as specified in some MSDN articles.
Cheers,
Ben
 
Ad

Advertisements

K

Ken Slovak - [MVP - Outlook]

Well, I don't do .NET for Outlook, too many problems. But you need an OCX
for a property page, not a class module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top