Using VTSO Add-In to Iterate through all Enterprise Custom Fields

J

Jim Allred

I'm writing an MS Project 2007 application add-in using VTSO. Within this
add-in I need to read and display all Enterprise Custom Fields that are
available within the active project file.

So far I have found the following:

1. Many examples of reading and writing enterprise custom fields based on
the FieldNameToFieldConstant() function. Unfortunately, this function
requires that I know the name of the Enterprise field ahead of time. I will
not know all of the field names ahead of time.

2. I can iterate through all of the predefined custom fields (cost1, cost2,
etc.) by looping through the values of the PjField enum and calling
FieldConstantToFieldName(). This method does not require any field names.
Unfortunately, this method does not return any Enterprise Custom Fields. I
suppose their ID's are not predefined within the PjField enumeration.

So, I sure could use some help or a point in the right direction.

Thanks in advance,
Jim
 
R

Rod Gill

I think the only way of finding all Enterprise Custom Fields using VBA is to
read the Views in the Reporting db ending with _userview. They have all
Custom Fields added as the last columns so you should be able to read them
using OLEDB

--

Rod Gill
Microsoft MVP for Project

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

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