读取/获取项目 VBA 中对象的当前值 [英] Read/get the current value of an object in Project VBA
问题描述
我正在努力在 MS Project VBA 中保存对象的当前值(至少我认为它是一个对象).
I'm struggling to save the current value of an object (at least I think it's an object) in MS Project VBA.
这是我想要做的,保存当前标题文本的值.
Here's what I'm trying to do, save the value of my current header text.
dim a As String (or Variant/Object?)
a = Application.FilePageSetupHeader.Text.Value
这显然行不通,但明白了这一点.其语法为:
This obviously doesn't work, but gets the point across. The syntax for this is:
expression. FilePageSetupHeader( ** Name, ** Alignment, ** Text** )
名称和文本作为字符串传递.
with Name and Text being passed as a string.
如果我让它工作,我也会有兴趣从这个对象中提取 NormalType
值.请注意,我必须指定项目:
If I get this to work, I'll also be interested in extracting the NormalType
value from this object. Notice I'll have to specify the item:
GridlinesEditEx Item:=4, NormalType:=1
任何帮助将不胜感激!
推荐答案
FilePageSetupHeader
是应用程序对象的方法,而不是<强>属性(参见 MSDN).MS Project 对象模型没有要查询的标题对象,因此不幸的是,标题(和页脚)是只写的.
FilePageSetupHeader
is a method of the application object, not a property (see MSDN). The MS Project object model does not have a header object to interrogate, so unfortunately the headers (and footers) are write-only.
这篇关于读取/获取项目 VBA 中对象的当前值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!