I was recently trying to set a number of different project level custom fields using VBA and got tired of finding and editing all the parameters so I wrote a small wrapper function that you may find useful:
Private Function setPField(ByVal field As String, ByVal newValue As String, ByRef proj As Project)
pfield = FieldNameToFieldConstant(field, pjProject)
proj.ProjectSummaryTask.SetField FieldID:=pfield, value:=newValue
End Function
It does two things. First it converts the field name into the field constant. This way you can supply the name of the field. Then it uses that field and sets the text value. It might not seem like much but it does make it easier for me to reuse this function, than having to search through a longer statement and find out what I need to set. To use it just supply the field name, the value and the project like this:
setPField field:="My Custom Field", newValue:="foo", proj:=ActiveProject