Read/get the current value of an object in Project VBA

折月煮酒 提交于 2021-01-28 06:48:53

问题


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.

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

Any help would be appreciated!


回答1:


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.



来源:https://stackoverflow.com/questions/48721287/read-get-the-current-value-of-an-object-in-project-vba

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!