2017-05-16 2 views
1

새 속성으로 기존 전자 메일을 업데이트하려고하는데 작동하지 않습니다 .. 시간 스탬프 문자열이 포함 된 사용자 지정 속성을 추가하여 테스트하고 있습니다 ..EWS SetExtendedProperty 문제

다음

message.Load(); 
Guid MyPropertySetId = new Guid("{117c7745-5df5-4049-97be-8e2d2d92d566}"); 
ExtendedPropertyDefinition extendedPropertyDefinition = new ExtendedPropertyDefinition(MyPropertySetId, "JNB", MapiPropertyType.String); 
message.SetExtendedProperty(extendedPropertyDefinition, DateTime.Now.AddDays(2).ToString()); 
message.Update(ConflictResolutionMode.AlwaysOverwrite); 

과 :이 내가 전혀에서 확장 된 속성을 볼 수 없습니다 실행 한 후 해당 항목을 ... 가져올 때

여기

내가 저장하기 위해 노력하고있어 방법 다시 넣으면 다음과 같이됩니다.

단지 확장 된 속성이 없습니다
if (item.ExtendedProperties.Count > 0) 
{ 
    // Display the name and value of the extended property. 
    foreach (ExtendedProperty extendedProperty in item.ExtendedProperties) 
    { 
     if (extendedProperty.PropertyDefinition.Name == "ccpUniqueID") 
     { 
      messageAlreadyLogged = AccountMessageManager.HasMessageAlreadyBeenSaved(extendedProperty.Value.ToString()); 
     } 

    } 
} 

....

+0

이 S/O 솔루션과 유사합니까? http://stackoverflow.com/questions/3304157/error-when-i-try-to-read-update-the-body-of-a-task-via-ews-managed-api-you-m – tgolisch

답변

1

교환은 당신이 당신이 다음 속성을 설정하고 해당 속성을 추가해야합니다 귀하의 경우 이렇게 반환에게 확장 된 속성을 반환합니다 로드를 사용하여 다시로드하십시오 (기본값은 아닙니다). 예 :

 Guid MyPropertySetId = new Guid("{117c7745-5df5-4049-97be-8e2d2d92d566}"); 
     ExtendedPropertyDefinition extendedPropertyDefinition = new ExtendedPropertyDefinition(MyPropertySetId, "JNB", MapiPropertyType.String); 
     PropertySet psPropSet = new PropertySet(BasePropertySet.FirstClassProperties){extendedPropertyDefinition}; 
     message.Load(psPropSet);