How to get a MS-Project TableField with a *blank* Title?

J

J. Mitchell

The following code is in Delphi (pascal). prjActiveProject is the MS-Project
application variable.

// This works:
TaskTable := prjActiveProject.TaskTables.Add(TableName, pjTaskID, True);
TaskTable.TableFields.Add(pjTaskName, pjLeft, 24, 'Task Name',
pjLeft, -1, True);

// But this fails:
TaskTable := prjActiveProject.TaskTables.Add(TableName, pjTaskID, True);
TaskTable.TableFields.Add(pjTaskName, pjLeft, 24, '', pjLeft, -1, True);
// title is ''

Although
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/pjsdk/html/pjmthadd.asp
states:

TableFields (Syntax 13)
Syntax 13

expression .Add(Field, AlignData, Width, Title, AlignTitle, Before,
AutoWrap)

Title Optional String. The title of the table field.


Nevertheless, the problem seems to that the Title cannot be blank for some
reason, as:

// This works:
prjApplication.ActiveProject.TaskTables.Item[2].TableFields.Item[3].Title
:= 'blah';
// This doesn't:
prjApplication.ActiveProject.TaskTables.Item[2].TableFields.Item[3].Title
:= '';

' However, the equivalent VB code does work:
Application.ActiveProject.TaskTables.Item(2).TableFields.Item(3).Title :=
""


My question is: how can I have a table field with a blank title (blank, not
space)? TIA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top