Hi Paschal,
If you wanted to incorporate all of the controls and tabs from the original
Task Information dialog then you would need to create a form within your
COM Addin that contains all of the tabs and their associated controls from
the Task Information dialog and then using the object browser try to
implement the functionality contained within these controls.
The only other option that I can think of would be to display the built-in
Task Information dialog and then also display your custom form which would
only contain you custom functionality and position your form with respect
to the Task Information dialog.
Regarding your question concerning how to implement your form when a user
clicks the Task Information item, I have included some sample code below
that can be implemented within Visual Basic 6 to create a COM Addin for
Microsoft Project that traps the click event of the Task Information item
and displays a simple message box. This code could be modified to load
your custom form when the Task Information item was clicked.
Sample Addin Code
===================
Option Explicit
Implements IDTExtensibility2
'Global object references
Public appHostApp As Object
Private cbStandard As Office.CommandBar
Private WithEvents cbTaskInfo As Office.CommandBarButton
Private Sub cbTaskInfo_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)
'Cancel the default action.
CancelDefault = True
'Display a custom message box.
MsgBox "Task Information was clicked"
End Sub
Private Sub IDTExtensibility2_OnAddInsUpdate(custom() As Variant)
End Sub
Private Sub IDTExtensibility2_OnBeginShutdown(custom() As Variant)
End Sub
Private Sub IDTExtensibility2_OnConnection(ByVal _
Application As Object, ByVal ConnectMode As _
AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst _
As Object, custom() As Variant)
'Store startup reference
Set appHostApp = Application
Set cbStandard = appHostApp.CommandBars("Standard")
Set cbTaskInfo = cbStandard.Controls("Task &Information...")
End Sub
Private Sub IDTExtensibility2_OnDisconnection(ByVal _
RemoveMode As AddInDesignerObjects.ext_DisconnectMode, _
custom() As Variant)
Set appHostApp = Nothing
End Sub
Private Sub IDTExtensibility2_OnStartupComplete(custom() As Variant)
End Sub
======================
If you have any questions please let me know via the posting.
Regards,
Ken Laws
Microsoft Support
This posting is provided "AS IS" with no warranties, and confers no rights.