Problems adding custom property pages 
Author Message
 Problems adding custom property pages

I'm trying to learn how to create a COM Add-in for Outlook
by following the example at:


I think that I understand the directions, mostly.  
However, after I build my COM-Addin, I don't see the "Wrox
Phone Number Changer" property page when I right-click on
a Contacts folder in the Folder List.  Instead, I see
General, Home Page, Outlook Address Book, Activities,
Administration, Forms, Permissions, and Synchronization
tabs instead.

I had added the following Sub to my Outlook 2000 VBA code,
and restarted Outlook, I've even tried rebooting:

Private Sub moNS_OptionsPagesAdd(ByVal Pages As
PropertyPages, _

  ByVal Folder As MAPIFolder)

  On Error Resume Next

  'For all contact folders load the custom Property Page.

  If Folder.DefaultItemType = olContactItem Then

    Pages.Add "PropertyPage.ctlPhoneChanger", "Wrox Phone
Number Changer"

  End If

End Sub

Strangely, if I try to compile PhoneChanger.dll with
Outlook running I get

Permission denied: 'C:\mypath\PhoneChanger.dll'

So it looks like Outlook has the .dll loaded.  As in the
example, I have my dsrPhoneChanger in a PhoneChanger.vbp
project and the basPhoneChanger and ctlPhoneChanger in a
PropertyPage.vbp project.  

Both projects are in a PhoneChanger.vbg group.  The
package and deployment wizard won't let me choose the
*.vbg, so I choose the PhoneChanger.vbp project and add
the PropertyPage.ocx to my project.  I tried shutting down
Outlook, running the setup.exe in my Package folder, and
restarting Outlook, but I still don't see the property

The code is basically cut and paste, all I had to do was
make sure to name my controls the same as in the example.  

I commented out the following routines, that were added
automatically to my dsrPhoneChanger:

'Sub Hide()
'    On Error Resume Next
'    FormDisplayed = False
'    mfrmAddIn.Hide
'End Sub

'Sub Show()
'    On Error Resume Next
''    If mfrmAddIn Is Nothing Then
''        Set mfrmAddIn = New frmAddIn
''    End If
''    Set mfrmAddIn.VBInstance = VBInstance
''    Set mfrmAddIn.Connect = Me
''    FormDisplayed = True
''    mfrmAddIn.Show
'End Sub

''this method adds the Add-In to VB
'Private Sub AddinInstance_OnConnection(ByVal Application
As Object, ByVal ConnectMode As
AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As
Object, custom() As Variant)
'    On Error GoTo error_handler
'    'save the vb instance
'    Set VBInstance = Application
'    'this is a good place to set a breakpoint and
'    'test various addin objects, properties and methods
'    Debug.Print VBInstance.FullName
'    If ConnectMode = ext_cm_External Then
'        'Used by the wizard toolbar to start this wizard
'        Me.Show
'    Else
'        Set mcbMenuCommandBar = AddToAddInCommandBar("My
'        'sink the event
'        Set Me.MenuHandler =
'    End If
'    If ConnectMode = ext_cm_AfterStartup Then
'        If GetSetting
(App.Title, "Settings", "DisplayOnConnect", "0") = "1" Then
'            'set this to display the form on connect
'            Me.Show
'        End If
'    End If
'    Exit Sub
'    MsgBox Err.Description
'End Sub

''this method removes the Add-In from VB
'Private Sub AddinInstance_OnDisconnection(ByVal
RemoveMode As AddInDesignerObjects.ext_DisconnectMode,
custom() As Variant)
'    On Error Resume Next
'    'delete the command bar entry
'    mcbMenuCommandBar.Delete
'    'shut down the Add-In
'    If FormDisplayed Then
'        SaveSetting
App.Title, "Settings", "DisplayOnConnect", "1"
'        FormDisplayed = False
'    Else
'        SaveSetting
App.Title, "Settings", "DisplayOnConnect", "0"
'    End If
'    Unload mfrmAddIn
'    Set mfrmAddIn = Nothing
'End Sub
'Private Sub IDTExtensibility_OnStartupComplete(custom()
As Variant)
'    If GetSetting
(App.Title, "Settings", "DisplayOnConnect", "0") = "1" Then
'        'set this to display the form on connect
'        Me.Show
'    End If
'End Sub

''this event fires when the menu is clicked in the IDE
'Private Sub MenuHandler_Click(ByVal CommandBarControl As
Object, handled As Boolean, CancelDefault As Boolean)
'    Me.Show
'End Sub

It seems pretty straight-forward, any idea what I could
have done wrong?

Mon, 29 Dec 2003 21:28:11 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Custom property page problems

2. Problem with list of pages in a custom property

3. Getting Page Custom Properties onto a new page

4. Problem after using Add Property Page with Wizard

5. Adding an additional property page to a windows prop page

6. COM Addin for Custom Property Page

7. Setting shape custom prop to page's property

8. Custom control property page

9. tab strip custom properties page appearing in my finished exe

10. Custom property page not displayed

11. Help with Adding a Custom Page Size

12. how to add custom properties to folder?


Powered by phpBB® Forum Software