2014-01-22 3 views
0
  // Global variables 
      var _Item; 
      var _MyEntities; 

      // The initialize function is required for all apps. 
      Office.initialize = function (reason) { 
       var _mailbox = Office.context.mailbox; 
       // Obtains the current item. 
       Item = _mailbox.item; 
       // Reads all instances of supported entities from the subject 
       // and body of the current item. 
       MyEntities = _Item.getEntities(); 

       // Checks for the DOM to load using the jQuery ready function. 
       $(document).ready(function() { 
       // After the DOM is loaded, app-specific code can run. 
       }); 
      } 

      // Gets instances of the Address entity on the item. 
      function myGetAddresses() 
      { 
       var htmlText = ""; 

       // Gets an array of postal addresses. Each address is a string. 
       var addressesArray = _MyEntities.addresses; 
       for (var i = 0; i < addressesArray.length; i++) 
       { 
        htmlText += "Address : <span>" + addressesArray[i] + "</span><br/>"; 
       } 

       document.getElementById("entities_box").innerHTML = htmlText; 
      } 

전자 메일 주소에 액세스하려면 위 코드를 사용하고 있지만 entities_box div에서 결과를 볼 수 없습니다.Outlook365 항목에서 엔티티 문자열을 추출하십시오.

전자 메일 주소는 어떻게 참조 할 수 있습니까?

답변

0

엔티티는 메시지 자체에 추출 된 엔티티가있는 경우에만 사용할 수 있습니다 (예 : "123 Main St, New York, New York 10001"). 먼저 주소가 실제로 검색되었는지 확인하여 디버깅을 시작합니다 (Bing Maps 앱이 해당 메시지에서 활성화 되었습니까? 사용하도록 설정 했습니까?). 그런 다음 json.stringify를 호출하고 item.getEntities()가 실제로 반환하는 것을 확인합니다. 항목을 추출하는 방법에 대한 도움말은 다음과 같습니다. http://msdn.microsoft.com/en-us/library/office/fp161071(v=office.15).aspx

관련 문제