<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Outlook: Markierte eMail]]></title><description><![CDATA[<p>Hallo!</p>
<p>Weiß jemand, wie man die aktuell markierte eMail in Outlook auslesen kann?</p>
<p>Ich bräuchte die eMailadresse der aktuell ausgewählten eMail in Outlook. Kann man das irgendwie auslesen?</p>
<p>Ich hab ne Outlook.Application - und dann weiter? Mit &quot;CreateItem&quot; könnte ich eine neue eMail erstellen, ich möchte aber keine neue Mail schreiben, sondern auf die aktuell markierte Mail zugreifen...</p>
<p>tschüss<br />
Robert</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/75679/outlook-markierte-email</link><generator>RSS for Node</generator><lastBuildDate>Sun, 28 Jun 2026 19:55:15 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/75679.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 03 Jun 2004 09:12:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Outlook: Markierte eMail on Thu, 03 Jun 2004 09:12:51 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Weiß jemand, wie man die aktuell markierte eMail in Outlook auslesen kann?</p>
<p>Ich bräuchte die eMailadresse der aktuell ausgewählten eMail in Outlook. Kann man das irgendwie auslesen?</p>
<p>Ich hab ne Outlook.Application - und dann weiter? Mit &quot;CreateItem&quot; könnte ich eine neue eMail erstellen, ich möchte aber keine neue Mail schreiben, sondern auf die aktuell markierte Mail zugreifen...</p>
<p>tschüss<br />
Robert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/532163</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/532163</guid><dc:creator><![CDATA[rowisoft]]></dc:creator><pubDate>Thu, 03 Jun 2004 09:12:51 GMT</pubDate></item><item><title><![CDATA[Reply to Outlook: Markierte eMail on Thu, 03 Jun 2004 13:17:50 GMT]]></title><description><![CDATA[<p>ola ist das TOutlookApplication-Object</p>
<pre><code>__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
ola-&gt;Connect();
ns = ola-&gt;GetNamespace(WideString(&quot;MAPI&quot;));
}
</code></pre>
<p>die Mailadresse aller ungelesenen Mails werden in einer Listbox (lb3) angezeigt</p>
<pre><code>void __fastcall TForm1::Button2Click(TObject *Sender)
{
FoldersPtr pFolders ;
MAPIFolderPtr pFolder, pFolder2;
MailItemPtr pMI;
ItemsPtr pItms;

ns-&gt;Logon(&quot;&quot;, &quot;&quot;, False, False);
pFolders = ns-&gt;Folders;
pFolder = ns-&gt;GetDefaultFolder(olFolderInbox);
pFolder-&gt;Display();

int NewMail = 0, UnsentMail = 0;
NewMail = pFolder-&gt;UnReadItemCount;
if (NewMail &gt; 0)
	{
	ShowMessage(&quot;Ungelesene Mails im Posteingang: &quot; + IntToStr(NewMail));
	pItms = pFolder-&gt;Items;
	for (int i=1; i&lt;=pItms-&gt;Count; i++)
		{
		v = Variant(i);
		pMI = pItms-&gt;Item(v);
		if (pMI-&gt;UnRead)
			{
			pMI-&gt;UnRead = false;
			String str = pMI-&gt;SenderEmailAddress;
			lb3-&gt;Items-&gt;Add(str);
			}
		}
	}

pFolder2 = ns-&gt;GetDefaultFolder(olFolderOutbox);
UnsentMail = pFolder2-&gt;Items-&gt;Count;
if (UnsentMail &gt; 0) ShowMessage(&quot;Ungesendete Mails im Postausgang: &quot; + IntToStr(UnsentMail));

ns-&gt;Logoff();
ola-&gt;Quit();
ola-&gt;Disconnect();  
}
</code></pre>
<p>und in den Header:</p>
<pre><code>private:	// Anwender-Deklarationen
  _NameSpacePtr ns;
</code></pre>
<p>und hier noch einen Link zu den OutlookKomponenten:<br />
<a href="http://www.officewiki.org/default.aspx/Outlook.OutlookIndex" rel="nofollow">http://www.officewiki.org/default.aspx/Outlook.OutlookIndex</a></p>
<p>Viel Spaß,<br />
Linnea</p>
]]></description><link>https://www.c-plusplus.net/forum/post/532338</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/532338</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Thu, 03 Jun 2004 13:17:50 GMT</pubDate></item><item><title><![CDATA[Reply to Outlook: Markierte eMail on Thu, 03 Jun 2004 18:35:33 GMT]]></title><description><![CDATA[<p>Hallo Linnea!</p>
<p>Erstmal vielen vielen Dank für die Antwort!</p>
<p>Damit kann ich die nicht gelesenen Objekte herausbekommen, das klappt. Gibt's auch ne Möglichkeit, die aktuell markierten Objekte zu erhalten? (also alle markierten, sozusagen die blau unterlegten)</p>
<p>Zudem _wäre es nicht schlecht_ wenn das ganze mit später Bindung erfolgen könnte, weil ich sonst auf eine bestimmte Version vom Outlook angewiesen bin (stimmt doch, oder??)</p>
<p>Ich habe folgenden Ansatz:</p>
<pre><code class="language-cpp">Variant OutlookApp, Explorer, Selection;

  try
  {
    OutlookApp = GetActiveOleObject(&quot;Outlook.Application&quot;);
  }
  catch (...)
  {
    try
    {
      OutlookApp = CreateOleObject(&quot;Outlook.Application&quot;);
    }
    catch (...)
    {
      ShowMessage(&quot;Outlook nicht installiert&quot;);
    }
  }

  try
  {
    Explorer = OutlookApp.OlePropertyGet(&quot;Explorers&quot;);

    //funktioniert nicht:
    Selection = Explorer.OleFunction(&quot;get_Selection&quot;);
  }
  __finally
  {
  }
</code></pre>
<p>Würde mich freuen, wenn man mir helfen kann <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
<p>tschüss<br />
Robert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/532542</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/532542</guid><dc:creator><![CDATA[rowisoft]]></dc:creator><pubDate>Thu, 03 Jun 2004 18:35:33 GMT</pubDate></item><item><title><![CDATA[Reply to Outlook: Markierte eMail on Mon, 07 Jun 2004 06:07:50 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Weiß denn keiner, wie das geht?<br />
In Outlook gibt's da wohl irgendwo die Eigenschaft &quot;Selection&quot;, ich weiß aber nicht, wie ich darauf im C++Builder zugreifen kann...</p>
<p>Würde mich sehr freuen, wenn jemand ne Lösung anbieten könnte...</p>
<p>tschüss<br />
Robert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/534745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/534745</guid><dc:creator><![CDATA[rowisoft]]></dc:creator><pubDate>Mon, 07 Jun 2004 06:07:50 GMT</pubDate></item><item><title><![CDATA[Reply to Outlook: Markierte eMail on Mon, 07 Jun 2004 08:37:46 GMT]]></title><description><![CDATA[<p>Hiermit müßte der Zugriff auf die markierten Mails möglich sein</p>
<pre><code>ExplorerPtr pExp;
SelectionPtr pSel;

Variant v = Variant(1);
//ein Outlookfenster auswählen
pExp = ola-&gt;Explorers-&gt;Item(v);
//und aktivieren
pExp-&gt;Activate();
pSel = pExp-&gt;Selection;

for (int i=1; i&lt;=pSel-&gt;Count; i++)
	{
	v = Variant(i);
	pMI = pSel-&gt;Item(v);
	String str = pMI-&gt;Subject;
	lb3-&gt;Items-&gt;Add(str);
    }
</code></pre>
<p>man kann über</p>
<pre><code>ExplorersPtr pExps;
ExplorerPtr pExp;

pExps = ola-&gt;Explorers;

for (int i=1; i&lt;=pExps-&gt;Count; i++)
	{
    if (pExps-&gt;Activate()) 
        {
        Variant v = Variant(i);
        pExp-&gt;Item(v);
        }
    }
</code></pre>
<p>auch nur auf das aktive Outlook-Fenster zugreifen</p>
<p>zur späten Bindung hab ich nur nen Delphi-Link <a href="http://www.delphi-source.de/tipps/COM_OLE_DDE/?id=35" rel="nofollow">http://www.delphi-source.de/tipps/COM_OLE_DDE/?id=35</a></p>
<p>Grüße<br />
Linnea</p>
]]></description><link>https://www.c-plusplus.net/forum/post/534827</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/534827</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Mon, 07 Jun 2004 08:37:46 GMT</pubDate></item><item><title><![CDATA[Reply to Outlook: Markierte eMail on Mon, 07 Jun 2004 09:22:52 GMT]]></title><description><![CDATA[<p>Hallo Linnea!</p>
<p>Vielen, vielen Dank!!!<br />
Hat mir sehr geholfen, Danke!!</p>
<p>Der Vollständigkeit halber, das ganze nochmal mit später Bindung:<br />
(für den Fall, dass mal irgendjemand über die Suche drauf stoßt...)</p>
<pre><code class="language-cpp">Variant ola;
  try
  {
    ola = GetActiveOleObject(&quot;Outlook.Application&quot;);
  }
  catch (...)
  {
    try
    {
      ola = CreateOleObject(&quot;Outlook.Application&quot;);
    }
    catch (...)
    {
      ShowMessage(&quot;Outlook nicht installiert&quot;);
    }
  }

  Variant pExp;
  Variant pSel;
  Variant pMI;

  Variant v = Variant(1);
  //ein Outlookfenster auswählen
  pExp = ola.OlePropertyGet(&quot;Explorers&quot;).OleFunction(&quot;Item&quot;, v);
  //und aktivieren
  pExp.OleFunction(&quot;Activate&quot;);
  pSel = pExp.OlePropertyGet(&quot;Selection&quot;);

  for (int i=1; i&lt;=pSel.OlePropertyGet(&quot;Count&quot;); i++)
  {
    v = Variant(i);
    pMI = pSel.OleFunction(&quot;Item&quot;, v);
    String str = pMI.OlePropertyGet(&quot;SenderName&quot;);
    lb3-&gt;Items-&gt;Add(str);
  }
</code></pre>
<p>Danke nochmal &amp; tschüss<br />
Robert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/534860</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/534860</guid><dc:creator><![CDATA[rowisoft]]></dc:creator><pubDate>Mon, 07 Jun 2004 09:22:52 GMT</pubDate></item></channel></rss>