处理宏的自定义字段? [英] Handle custom fields at macro ?

查看:82
本文介绍了处理宏的自定义字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很高兴与MS-Project合作,我在项目中添加了一些自定义字段,需要通过执行某些操作来更新其值在macros请建议我如何实现这个功能。

I am very new to work with MS-Project,  i have added few custom fields in project and need to update their values by performing certain operations at macros please suggest me how can achieve this functionality.

谢谢,

 

C Mahone

推荐答案

C. Mahone,

C. Mahone,

您可以随时通过其字段名称引用任何自定义字段,或者您也可以通过"友好"字段引用它们。名称。例如,假设您已将任务Text1字段重命名为"Customers"字段。并且您希望将该字段值设置为"Costco"。对于活动项目
中的任务ID 1。下面的第一种方法是通过普通字段名称来实现的。第二种方法是通过友好字段名称来完成的。

You can always refer to any custom field by its field name, or you also reference them by their "friendly" name. For example, let's say you've renamed the task Text1 field as "Customers" and you want to set that field value to be "Costco" for task ID 1 in the active project. The first method below does it via the normal field name. The second method does it via the friendly field name.

方法1:

Sub SetCustFieldVal()

ActiveProject。任务(1).Text1 =" Costco"

End Sub

Sub SetCustFieldVal()
ActiveProject.Tasks(1).Text1 = "Costco"
End Sub

方法2:

Sub SetCustFieldVal()

Dim FldCst As String

FldCst = FieldNameToFieldConstant(" customers",pjTask)

ActiveProject.Tasks(1).SetField FieldID:= FldCst,Value:=" Costco"

End Sub

Sub SetCustFieldVal()
Dim FldCst As String
FldCst = FieldNameToFieldConstant("customers", pjTask)
ActiveProject.Tasks(1).SetField FieldID:=FldCst, Value:="Costco"
End Sub

希望这会有所帮助。

John


这篇关于处理宏的自定义字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆