Where do you put event code

M

Mark Durrenberger

I'm building a add-in for MS project and I don't know where to put event
code (project change event) so it will fire.

I've searched the newsgroup for this one, no luck yet
Thanks,
Mark






--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is
that failure comes as a complete surprise and is not
preceded by a period of worry and depression.

- Sir John Harvey-Jones
 
M

Mark Durrenberger

Found it

http://www.microsoft.com/downloads/...5D-AF9F-45B2-878A-34096BBCEA5F&displaylang=en

--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is
that failure comes as a complete surprise and is not
preceded by a period of worry and depression.

- Sir John Harvey-Jones
 
M

Mark Durrenberger

Nope - not exactly what I was looking for...


--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is
that failure comes as a complete surprise and is not
preceded by a period of worry and depression.

- Sir John Harvey-Jones
 
M

Mark Durrenberger

To add events to an MS Project add-in

In your connect code (In the Designer - connect.dsr)

===== Code for your designer =====

Dim X As New YourClassModule
'
' connect the events code - set a reference to your class module
'
Set X.MSPApp = MSProject.Application

===== end code for your designer =====

Create a class module

name it "YourClassModule"

Then code up your events in the class module

===== Class Module "YourClassModule" =====
Public WithEvents MSPApp As MSProject.Application

Private Sub MSPApp_ProjectBeforeTaskChange(ByVal tsk As MSProject.Task,
ByVal Field As MSProject.PjField, ByVal NewVal As Variant, Cancel As
Boolean)
MsgBox "A task change to be made.", vbOKOnly
End Sub

===== end class module =====

Compile and go!

Mark


--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is
that failure comes as a complete surprise and is not
preceded by a period of worry and depression.

- Sir John Harvey-Jones
 

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