Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Outlook geöffnete E-Mail auslesen

Empfohlene Antworten

Veröffentlicht

Hallo,

ich würde gerne für Outlook ein Addin schreiben, dass die aktuelle E-Mail ausließt. Sprich ich öffne eine E-Mail in Outlook und betätige einen Button, der mir den aktuellen E-Mail Text, Absender, Empfänger in Variablen schreibt, die ich dann später weiter verarbeiten kann.

Leider finde ich im Internet nur wenig hilfreiche Seiten. In der MSDN Libary kann ich nur ein Beispiel finden, wie ich eine E-Mail mit dem Addin schreibe, jedoch nicht, wie ich z.B. auf die aktuell geöffnete E-Mail zugreife.

Kann mir jemand evt. ein paar Tipps geben wie ich weiter komme? Oder hat jemand viell. schon mal ein solches Addin geschrieben?

LG

Black-Rider

An welcher Stelle hängst du denn?

Kannst du denn schon auf die E-Mail bzw. Outlook zugreifen?

Genau da hänge ich.

Wie kann ich die aktive E-Mail aus Outlook erfassen? Zugriff auf Outlook habe ich mittels Microsoft.Office.Interop.Outlook & Microsoft.Office.Core

hier mal ein paar kleine hinweise ;-)

private Ol.Application myApplication;


public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)

{

myApplication = (Ol.Application)application;

}


(Ol.MailItem)myApplication.ActiveInspector().CurrentItem;

Ol steht für

using Ol = Microsoft.Office.Interop.Outlook;

Das mit OL hab ich mir schon gedacht.

Leider scheint das ADDIn sich aufzuhängen.


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Xml.Linq;

using System.Windows.Forms;

using Outlook = Microsoft.Office.Interop.Outlook;

using Office = Microsoft.Office.Core;

using Extensibility;


.....


public partial class ThisAddIn

{

  Outlook.Application myApplication;



....


public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)

{

  myApplication = (Outlook.Application)application;

}


.....

private void ButtonClick(Office.CommandBarButton ctrl,ref bool cancel)

{

  MessageBox.Show("You clicked: " + ctrl.Caption);

  Outlook.MailItem active_mail = (Outlook.MailItem)myApplication.ActiveInspector().CurrentItem;

  MessageBox.Show(active_mail.Body);

}

....

}

Die erste Messagebox wird noch ausgegeben. Doch dann passiert nichts weiter. Der Debugger bricht ohne Fehlermeldung einfach ab.

Die Methode OnConnection wird auch komischer weise nicht aufgerufen. Ist es richtig, dass ich die Extensibility.dll extra einbinden musste? Sprich ich musste die DLL extra ins Projekt kopieren...

LG

Black-Rider

ja wenn die onconnection nicht aufgerufen wird, hast du auch keine referenz auf die application d.h. myApplication ist null...

wenn du im vs --> neu --> projekt --> other project types --> extensibility --> shared add-in klickst hast du alles schon parat

wahlweise kannst du auch dies per hand tun

du musst halt das interface Extensibility.IDTExtensibility2 einbinden

z.b.:

public partial class ThisAddIn : Object, Extensibility.IDTExtensibility2

Bearbeitet von xk4fu

Ich habe mich jetzt für den Weg entscheiden, das Projekt, wie oben beschreiben, neu zu erstellen.

Ich habe jetzt unter Projekt->neu->andere projekttypen->erweiterungen ein gemeinsames Addin erstellt. Jedoch ist in der dadruch erstellten Connect.cs Microsoft.Office.Interop.Outlook nicht verfügbar. Es gibt leider nur Microsoft.Office.Core :(

dann referenziers halt

add reference --> outlook ...

Was muss ich einstellen, damit sich das Projekt beim Debuggen in Outlook startet und nicht Visual Studio nochmal neu aufgeht ? Unter den Projekteingenschaften als externes Programm einfach Outlook auswählen?

Hat schon alles geklappt vielen dank ;-)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.