how to add a property page to the tools->options dialog (Outlook 2k, XP) using VB6

C

Christoph Guentner

Hi,

I want to add a property page to the tools->options dialog in outlook xp
using VB6.
I have done an COMAddIn. That works fine.
I have added a property page in my VB6 project.
And I have read that I can add my prop page in the function OptionsPagesAdd,
but how???

Here part of the example code from the help:

Private Sub OutlApp_OptionsPagesAdd(ByVal Pages As Outlook.PropertyPages)
Dim myPage As Object
Set myPage = CreateObject("PPE.CustomPage")
Pages.Add myPage
End Sub

But what do I write instead of
Set myPage = CreateObject("PPE.CustomPage")
to get my prop page added?
I have added my prop page in my vb project with the name myproppage, but
Set myPage = myproppage 'does not work
Thanks for any hint.

Regards,
Christoph
 
K

Ken Slovak - [MVP - Outlook]

First, are you declaring an Outlook.Application object using
WithEvents? You need that for the event handler for OptionsPagesAdd.
If that's OK then you have to make sure your property page was created
using a VB UserControl and compiled as an OCX. Once that's done you
just call your property page using this format, you don't need
CreateObject:

Dim strPPTitle As String

On Error Resume Next
strPPTitle = "Attachment Security && Options"
Pages.Add "AttOptPP.UserControl1", strPPTitle

The text you use to call your property page depends on the OCX name
("AttOptPP") and the name you gave the UserControl in that OCX
project. You don't need to add a reference to the OCX in your project
if the OCX was compiled on the same machine where you are compiling
the addin DLL.
 

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