How to:write to enterprise custom field from an add-in (C#)

O

omrivm

Hi,
I have a question about Enterprise Custom Fields.
I'm working on an add-in and I have the Application object (that I
converted to Microsoft.Office.Interop.MSProject.Application), now i
want to write a value to an enterprise custom field. I don't want to
use the PSI because I already have the application object.
So, how it can be done in the application object?

Thanks,
Omri
 
R

Rod Gill

Easiest way to find out is to record a macro in Project VBA of you doing
what you want manually. The recorded code will provide the Objects and
properties etc. You then just need to convert to C#.
 
×

עמרי

When i try to do so, all i got is this:

Sub Macro1()
' Macro Macro1
ProjectSummaryInfo
End Sub

and i can't see ProjectSummaryInfo... so... nothing...
 
R

Rod Gill

The project Summary Information dialog has nothing to do with Enterprise
custom fields. To edit these you have to insert the relevant columns.

To read/Write Properties use:
ActiveProject.BuiltinDocumentProperties("Subject")="My Subject"
 
×

עמרי

BuiltinDocumentProperties is a property not a method...
and how the user change the Enterprise custom fields? from the project
Information... no?

Thanks,
Omri
 
R

Rod Gill

There are project enterprise fields under Project Information. However if
you insert EnterpriseTaskText1 that value against the project Summary Task
is the Project level, not task level. So record a macro of you editing an
Enterprise field at the Project Summary level and there is your answer.
 
P

Pat

In VBA:

ActiveProject.ProjectSummaryTask.SetField pjCustomProjectEnterpriseText1,
"Hi all"
 
O

Omri Swissa

But i want to write to the enterprise fields under Project Information not
under the project Summary, do you know how it can be done?

Thanks,
Omri
 
O

Omri Swissa

I see... Thanks a lot!
I don't use VBA I'm using PSI (I'm write in C#) where in the PSI I can do
the same thing?
Because in the PSI I can edit the ProjectSummaryTask but I can see there
only the "fixed" Enterprise fields like "Text1" and etc.
I can't see where I can give my custom field name and value…

Thanks a lot,
Omri swissa
 

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