处理宏的自定义字段?

编程入门 行业动态 更新时间:2024-10-25 10:30:42
本文介绍了处理宏的自定义字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我很高兴与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

更多推荐

处理宏的自定义字段?

本文发布于:2023-11-23 18:27:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622449.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   字段

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!