Addin for MS Project 2002

D

Dotnet Force

Hi,

I wrote an Addin for MS Project 2002 in C#.
I want to allow the user to add some new properties for a given task. So
I'm wondering
if it is possible to add a new tab in the 'Task information' window.

So could someone tell if it is possible first ? And then could someone
give me some
pointer to articles which explain how we can do this ?

Thanks
Pascal Lenormand
 
K

Ken Laws [MS]

Hi Pascal,

In researching your question concerning the modification of the Task
Information dialog, I found another issue where someone wanted to add a new
tab and it was determined that this dialog could not be modified, other
than to set the values for the fields within the dialog.

You may be able to create a custom form that could be loaded in place of
the Task Information dialog that you could then customize to include the
additional information.

I hope this helps!

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.
 
D

dotnet-force

Hi Ken,

You propose me to define a new dialog to insert my tab on it.
But where can I get the default 'Task information' window definition ?
Because I just want to add new tab but not remove the old ones. And
what's about the callback in all default tabs ?

And then how can I display my new window when the user click on the
'Task information' item ?

Thanks for your help.
Pascal.
 
K

Ken Laws [MS]

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.
 

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