新しいタスクの属性の設定
新しいタスクの属性の設定
Microsoft Projectを使用すると、追加された新しいタスクのデフォルトプロパティを設定できます。このトピックでは、C ++ APIのAspose.Tasksを使用して、新しいタスクのデフォルトの開始日を設定する方法について説明します。
プロジェクトクラスは、新しいタスクの開始日を定義する NewtaskStartDateプロパティを公開します。このプロパティは、 taskStartDateType列挙タイプで定義された値をサポートします。
タスク属性を表示するには:
Microsoftプロジェクトでファイルを開きます。
ツールメニューで、オプションを選択します。
スケジュールタブを選択します。
The tab looks like the one shown below.
New tasks set to start on the current date
The code example given below demonstrates how to set the new task start date.
1// The path to the documents directory.
2System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName());
3
4// Create a project instance Set new task property and Save the project as XML project file
5System::SharedPtr<Project> project = System::MakeObject<Project>();
6project->Set<TaskStartDateType>(Prj::NewTaskStartDate(), Aspose::Tasks::TaskStartDateType::CurrentDate);
7project->Save(dataDir + u"SetAttributesForNewTasks_out.xml", Aspose::Tasks::Saving::SaveFileFormat::XML);
8
9// Display Status.
10System::Console::WriteLine(u"New Task created with start date successfully.");