새로운 작업에 대한 속성 설정

새로운 작업에 대한 속성 설정

Microsoft Project를 사용하면 추가 된 새 작업에 대한 기본 속성을 설정할 수 있습니다. 이 주제는 C ++ API 용 Aspose.Tasks 를 사용하여 새로운 작업의 기본 시작 날짜를 설정하는 방법을 설명합니다.

Project 클래스는 새로운 작업의 시작 날짜를 정의하는 NewTaskStartDate 속성을 노출시킵니다. 이 속성은 TaskStartDateType 열거 유형으로 정의 된 값을 지원합니다.

작업 속성을 보려면 :

  1. Microsoft Project로 파일을 엽니 다.

  2. 도구 메뉴에서 옵션을 선택하십시오.

  3. 일정 탭을 선택하십시오.

The tab looks like the one shown below.

New tasks set to start on the current date

edit task’s schedule options in Microsoft Project

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.");
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.