Get content of costum enterprise field

L

L. Banks

Hes together,

i need to develop a vba-makro for ms project 2007: It should get the content
of a costum enterprise field. How do i get access to this?

Thanks in advance
 
L

L. Banks

Found this on http://www.projectified.com/
To access an Enterprise Task field called "Task Alignment" you would use the >following code:
Activeproject.Tasks(1).GetField(FieldID:=Application.FieldNameToFieldConstant(FieldName:="INSERT FIELD NAME),FieldType:=pjTask)
You use the GetField method. This method requires the FieldID. To get the FieldID (since it is unlikely you know it) you use the FieldNametoFieldConstant method.


So i changed it to

Dim IntExt as String

IntExt =
ActiveProject.Resources(1).GetField(FieldID:=Application.FieldNameToFieldConstant(FieldName:="IntExt"), FieldType:=psResource)

But i still get an error: Given argument not found (and it hovers "FieldType")

L. Banks
 
J

John

L. Banks said:
Found this on http://www.projectified.com/





So i changed it to

Dim IntExt as String

IntExt =
ActiveProject.Resources(1).GetField(FieldID:=Application.FieldNameToFieldConst
ant(FieldName:="IntExt"), FieldType:=psResource)

But i still get an error: Given argument not found (and it hovers
"FieldType")

L. Banks

L. Banks,
Unless you did a type when you wrote your post, there is no such
constant as "psResource". It should be "pjResource". Also, I believe you
need to give the standard field name, not the "friendly" field name. In
other words, if your "IntExt" is EnterpriseResourceText1, then use that
for the FieldName argument.

John
Project MVP
 

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