Excel 到 Ms Project VBA - 插入任务、设置字体、下划线和斜体
我在 VBA (Excel) 中有以下代码行,成功在 MS Project 中生成任务,并建立了正确的大纲级别。但是,我想将特定任务的“名称字段”的格式设置为带有下划线和或斜体:
示例代码:
ActiveProject.Tasks.Add ("Enter Task Name #1")
ActiveProject.Tasks ("Enter Task Name #1").OutlineLevel = 1
ActiveProject.Tasks.Add ("Enter Task Name #2")
ActiveProject.Tasks ("Enter Task Name #2").OutlineLevel = 2
ActiveProject.Tasks.Add ("Enter Task Name #3")
ActiveProject.Tasks ("Enter Task Name #3").OutlineLevel = 3
如何为正在导入的任务设置格式选项或者选择导入的任务并设置所需的格式?
I have the following lines of code in VBA (Excel), successfully generating tasks in MS Project, with the correct outline level established. However, I would like to set the formatting of the 'Name field' of a specific task to be have an underline AND OR be italicized:
Sample Code:
ActiveProject.Tasks.Add ("Enter Task Name #1")
ActiveProject.Tasks ("Enter Task Name #1").OutlineLevel = 1
ActiveProject.Tasks.Add ("Enter Task Name #2")
ActiveProject.Tasks ("Enter Task Name #2").OutlineLevel = 2
ActiveProject.Tasks.Add ("Enter Task Name #3")
ActiveProject.Tasks ("Enter Task Name #3").OutlineLevel = 3
How would I go about setting formatting options to a task that is being imported or selecting the imported task and setting the required formatting?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
输入任务后,使用 >选择任务和应用格式的方法,例如 Fontbold 。例如:
或者,请使用 fontex 可以一次使用多种格式。
Once the tasks are entered, use the Find method to select the task and the apply formatting such as FontBold. For example:
Alternatively, use FontEx which can be used to apply multiple formats at once.