View Full Version : MS-Project VBA Question


Cevikel
01-16-2006, 08:52 AM
Hi NG ,
I am new in the field of VBA and have a question / problem.
In one project file I defined a field ( customized field Number 13 )
and renamed it as "StatDur" and entered a formula there in.
With VBA I want to read out the contents of this field and display
it via MsgBox. Ihave entered following code

num = Application.CustomFieldValueListGetItem(pjCustomTaskNumber13,
pjValueListValue, 3)

Syntax is :
Ausdruck .CustomFieldValueListGetItem(FieldID, Item, Index)

Thats my code entered in VBA ( as above ):
num = Application.CustomFieldValueListGetItem(pjCustomTaskNumber13,
pjValueListValue, 3)

I want to store the contents of this field from row 3 in num and want to
display it via MsgBox.

It wont work since the VBA-Editor brings a failure where I am entering the
row number 3
as Index and I dont know why and how to solve this problem.
Can onyone give a helping hand.
Thanks in advance
Gruß

--
Cevikel
Tel. : 0911-433-6329
mailto:halidun.cevikel@siemens.com

Mike Glen
01-16-2006, 09:44 AM
Hi Cevikel ,

Try posting on the developer newsgroup as this one is closing down. Please
see FAQ Item: 24. Project Newsgroups. FAQs, companion products and other
useful Project information can be seen at this web
address:http://project.mvps.org/faqs.htm .

Mike Glen
Project MVP

Cevikel wrote:
> Hi NG ,
> I am new in the field of VBA and have a question / problem.
> In one project file I defined a field ( customized field Number 13 )
> and renamed it as "StatDur" and entered a formula there in.
> With VBA I want to read out the contents of this field and display
> it via MsgBox. Ihave entered following code
>
> num = Application.CustomFieldValueListGetItem(pjCustomTaskNumber13,
> pjValueListValue, 3)
>
> Syntax is :
> Ausdruck .CustomFieldValueListGetItem(FieldID, Item, Index)
>
> Thats my code entered in VBA ( as above ):
> num = Application.CustomFieldValueListGetItem(pjCustomTaskNumber13,
> pjValueListValue, 3)
>
> I want to store the contents of this field from row 3 in num and want
> to display it via MsgBox.
>
> It wont work since the VBA-Editor brings a failure where I am
> entering the row number 3
> as Index and I dont know why and how to solve this problem.
> Can onyone give a helping hand.
> Thanks in advance
> Gruß