Project Owner and Custom Fields from VBA

G

Gary Zag

How do I access the valve of the Project Owner and custom enterprise fields
of a project in Project Server 2007 from MS Project Pro VBA?

Gary
 
R

Rod Gill

Hi,

In Project Pro 2007 use:

activecell.task.getfield(application.fieldnametofieldconstant("Field
Name",pjTask))

This is from memory, so clearly I need a new life and there are no
guarantees this code will work as is!!
--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 
G

Gary Zag

Ron,

Thanks that works for the custom fields. Anyone know how to get the value
of Project Owner from VBA?

Gary
 
B

Bill B

Function GetOwner(p As Project) As String
On Error Resume Next
GetOwner = p.CustomDocumentProperties("Owner")
If Err Then ' 5 on fail
Err.Clear
GetOwner = ""
End If
On Error GoTo 0
End Function
 
G

Gary Zag

Bill,

This does not work. It produces an error. The CustomDocumentProperties
collection does not have a element with the Name of "Owner".

Gary
 

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