use macros in project server

J

Jose X Perez

Hi everyone,

I'm trying to use a macro in project server in order to update a custom task
field.
But i do not know how to access the value of others defined task custom
fields.
the macro that works localy in mi pc is

Private Sub App_ProjectBeforeTaskChange(ByVal t As Task, _
ByVal Field As PjField, _
ByVal NewVal As Variant, _
Cancel As Boolean)
If Field <> pjTaskNumber2 Then
If t.Summary Or t.OutlineLevel = 1 Then
Rem MsgBox ("summary")
t.Number2 = t.Number1 * t.Number3 / 100
End If
If t.Summary And t.OutlineLevel > 1 Then
t.Number2 = t.Number1 * t.OutlineParent.Number2 / 100
End If
If Not t.Summary And t.OutlineLevel > 1 Then
Rem MsgBox ("not summary")
t.Number2 = t.Number1 * t.OutlineParent.Number2 / 100
End If
End If
End Sub


in order to make this works in the preject server i need to access the
taskCustomFieldNumber isntead of Number1

How can i do this? or i must use PSI ?
i preffer not to use PSI because i'll need to use a programer and i do not
have the resource.

thanks for your help
Jose X Perez
 
D

Dale Howard [MVP]

Jose --

I would suggest you post this question in the
microsoft.public.project.developer newsgroup, as you are more likely to get
an answer in that group. Hope this helps.
 
P

Paul Conroy

Referencing custom fields via VBA

'Read Enterprise Custom Field

call
ActiveProject.ProjectSummaryTask.GetField(FieldNameToFieldConstant("customfieldname"))


'Write Enterprise Custom Field

call
ActiveProject.ProjectSummaryTask.SetField(FieldNameToFieldConstant("customfieldname"))
 
J

Jose X Perez

thanks a lot,
where can i get more information about this objects and procedures?
 

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