2013-11-22 4 views
4

Outlook 2010addin을 생성했습니다. 상황에 맞는 메뉴와 드래그 앤 드롭 영역이 있습니다.Outlook 2010에서 추가 기능이 Outlook 2010에서 작동하지 않습니다.

설치 프로그램 파일을 만들었습니다. outlook 2013이있는 PC에 설치하면 작동하지 않습니다.

모든 버전의 Outlook에서 작동 할 수있는 Outlook 버전 독립적 추가 기능은 어떻게 만듭니 까?

이 문제에 대한 도움을 주시면 감사하겠습니다 ...!

+0

Excel 2013이 열렸 기 때문에 Excel AddIn을 설치하는 데 문제가있었습니다. AddIn을 설치하기 전에 모든 Outlook 인스턴스가 닫혔는지 확인 했습니까? – Vache

+0

예 ..Outlook의 모든 인스턴스를 닫았습니다 ... –

+1

추가 기능이 전혀로드되지 않았는지 확인하기 위해 코드에 로깅 문을 추가 할 수 있습니까? Outlook의 추가 기능 목록에서 추가 기능을 찾으면 활성화되어 있습니까? 비활성화 되었습니까? 비활성화 된 경우 그 이유는 무엇입니까? (Outlook 2007에서 Outlook 2013에서 아무런 문제없이 작동하는 추가 기능을 작성했습니다. Outlook 2010과 2013에서는 RibbonMenu를 사용하고 2007 년에는 '정상'메뉴를 사용하고 있습니다.) –

답변

0

스테 윈 클러 오른쪽입니다 비주얼 스튜디오를 사용할 수 있습니다. 내 추가 기능이 Outlook 2010 및 2013에서 작동 할 수있는 방법을 찾았습니다.

내 추가 기능에는 앞에서 설명한대로 끌어서 놓기 영역과 컨텍스트 메뉴가 있습니다. 나는 outlook.Though의 소스를 가지고 있지는 않지만 2007에서 테스트 할 수있는 리본 메뉴를 만들었습니다.

드래그 앤 드롭 영역에 대해서는 Outlook 2013의 메일을 삭제할 때 Outlook 2010 메일보다 크기가 더 크다는 사소한 변화가있었습니다. 그래서 저는 메일의 변환 유형을 Int64으로 변경하여 두 메일을 모두 변환 할 수있는 수업을 진행했습니다. 여기

드래그에 대한 몇 가지 코드 및 지역 드롭 :

private void DragNDropArea_DragDrop(object sender, DragEventArgs e) 
{ 
    //wrap standard IDataObject in OutlookDataObject 
    OutlookDataObject dataObject = new OutlookDataObject(e.Data); 

    //get the names and data streams of the files dropped 
    string[] filenames = (string[])dataObject.GetData("FileGroupDescriptorW"); 
    MemoryStream[] filestreams = (MemoryStream[])dataObject.GetData("FileContents"); 

    for (int fileIndex = 0; fileIndex < filenames.Length; fileIndex++) 
    { 
     try 
     { 
      //use the fileindex to get the name and data stream 
      string filename = filenames[fileIndex]; 
      MemoryStream filestream = filestreams[fileIndex]; 



      string startupPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); 

      if (Directory.Exists(startupPath)) 
      { } 
      else 
      { 
        Directory.CreateDirectory(startupPath); 
      } 

      //save the file stream using its name to the application path 
      FileStream outputStream = File.Create(startupPath + "\\" + filename + ".msg"); 

      filestream.Seek(0, SeekOrigin.Begin); 
      filestream.WriteTo(outputStream); 

      outputStream.Close(); 
      filestream.Close(); 
      readMessage(filename, startupPath); 
     } 
     catch (System.Exception ex) 
     { 
      MessageBox.Show("Error Occured In getting Mail info..: \n" + ex.ToString()); 
     } 
    } 
} 

OutlookDataObject.cs 클래스의 GetData() 방법 :

//create a new array to store file names in of the number of items in the file group descriptor 
string[] fileNames = new string[fileGroupDescriptor.cItems]; 

//get the pointer to the first file descriptor 
IntPtr fileDescriptorPointer = (IntPtr)((Int64)fileGroupDescriptorAPointer + Marshal.SizeOf(fileGroupDescriptorAPointer)); 
//loop for the number of files acording to the file group descriptor 
for (int fileDescriptorIndex = 0; fileDescriptorIndex < fileGroupDescriptor.cItems; fileDescriptorIndex++) 
{ 
    //marshal the pointer top the file descriptor as a FILEDESCRIPTORA struct and get the file name 
    NativeMethods.FILEDESCRIPTORA fileDescriptor = (NativeMethods.FILEDESCRIPTORA)Marshal.PtrToStructure(fileDescriptorPointer, typeof(NativeMethods.FILEDESCRIPTORA)); 
    fileNames[fileDescriptorIndex] = fileDescriptor.cFileName; 

    //move the file descriptor pointer to the next file descriptor 
    fileDescriptorPointer = (IntPtr)((Int64)fileDescriptorPointer + Marshal.SizeOf(fileDescriptor)); 
} 

이 내가 드래그를 달성하고 메일 부분을 삭제하는 방법입니다. 하고 상황에 맞는 메뉴 :
Ribbon1.xml 파일 :

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load" loadImage="GetImage"> 
    <contextMenus> 
    <contextMenu idMso="ContextMenuMailItem"> 
     <button id="MyContextMenuMailItem" 
      label="OnePgr Integrator" 
      onAction="OnMyButtonClick" showImage="true" image="favicon.ico.ico"/> 
    </contextMenu> 
    <contextMenu idMso="ContextMenuMultipleItems"> 
     <button id="MyContextMenuMultipleItems" 
      label="OnePgr Integrator" image="favicon.ico.ico" 
      onAction="OnMyButtonClick"/> 
    </contextMenu> 
    </contextMenus> 
</customUI> 

Ribbon1.cs 클래스 :

public void OnMyButtonClick(Office.IRibbonControl control) 
{ 
    try 
    { 
      Outlook.Selection selectedMails = control.Context as Outlook.Selection; 
    } 
    catch (System.Exception ex) 
    { 
      MessageBox.Show(ex.ToString()); 
    } 
} 

이 선택 객체에서 나는 아웃룩 2010의 양쪽에 노력하고는 MailItem를 얻을 수 있습니다 2013 년.

답장을 보내 주셔서 감사합니다.

0

대부분의 Office/Outlook 2013 설치는 MSI가 아닌 C2R (클릭하여 실행)을 통해 수행됩니다. MSI는 2010 년 및 그 이전의 대부분의 설치 방법에 대한 설치 방법이었습니다.

설치시 detect C2R and account for it을 (를) 추가 할 수 있어야합니다. 마이크로 소프트에 따르면

+0

예 addin이 C2R을 감지 할 수 있습니다. –

0

,

당신은 아웃룩 2013 추가 기능 등을 개발하려는 경우, 당신은 비주얼 스튜디오 2010 또는 Visual Studio 2012

를 사용할 수있는 추가 기능 등을하여 Outlook 2010을 개발하려는 경우 만 2013

http://msdn.microsoft.com/en-us/office/hh133430.aspx

+0

예 그 기사도 읽었습니다. 하지만 내 경우에는 컨텍스트 메뉴와 끌어서 놓기 영역이있어서 Visual Studio 2010에서 추가 기능을 개발했으며 작동합니다. –

+0

내 대답을 확인하십시오 ... –

관련 문제