Accessing lookup table values when NOT connected to project server

S

SunGard

Help!

We need to programmatically access the custom field lookup table values when
project is NOT connected to project server.

Currently, in my VSTO code, I use the web reference to access lookup table
values which works perfectly if connected, but I want to also access the
"cached" values when not connected.

Somehow, MS Project itself in its native custom field editor has access to
the lookup table values. How can I programmatically get access to those
values in the cache?

Maybe this is really easy, but I am not finding how to get to those values!

I am using VB .NET, Vistual Studio 2008 VSTO with the code running in
Microsoft Project itself as an addin.
 
S

SunGard

Okay,
I've found this one. Here is a sample of the code to add entries to a combo
box using "local" lookup table values and not going through the PSI:

Dim oc As Microsoft.Office.Interop.MSProject.OutlineCode
For Each oc In
Globals.ThisAddIn.Application.GlobalOutlineCodes
If oc.FieldID = mycf.Field.MD_PROP_ID Then
Dim lt As
Microsoft.Office.Interop.MSProject.LookupTable = oc.LookupTable
For Each ltEntry As
Microsoft.Office.Interop.MSProject.LookupTableEntry In lt

myComboBox.Items.Add(New
ValueDescriptionPair(ltEntry.FullName, ltEntry.FullName))
Next ltEntry
End If
Next
 
Q

Quizzed again

SunGard, thank you for this data. I am not a programmer.

Is "mycf" your outline code with the lookup table?
What would change if I wanted to run this for a text field (not an OC?)?
And sorry to hit you up for so much data, but where do I put this code to
run it? In a macro?

Thank you so much for any more help!
QA
 
S

SunGard

Hi QA,

"mycf" is a class I created just to hold some custom field information for
the fields I was interested in. I used it to contain the field id of the
custom field and compare it to the outline code.

As for text fields I am not sure (because I was only working with custom
fields), but I think you'll be able to enumerate (loop) on the collection
once you know what collection it is (i.e. something similar to the
Microsoft.Office.Interop.MSProject.OutlineCode collection)

I am using Visual Studio 2008 VSTO to create this code/add in, but I think
you can do this in a VB macro as well if you don't use PSI features, etc.

This is all a bit new to me too, so I can only give pointers!
 

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