Einzelnen Beitrag anzeigen

LuckySpacy

Registriert seit: 2. Apr 2003
Ort: Fränkisch-Crumbach
50 Beiträge
 
Delphi 10.4 Sydney
 
#1

RTF Problem mit Outlook 2003

  Alt 1. Mär 2007, 15:48
Was hat sich Microsoft denn jetzt schon wieder einfallen lassen?
Was mit Outlook 2000 funktionierte geht mit Outlook 2003 nicht mehr.

Folgendes Problem:
Ich möchte gerne einen Richtext im email-Body anzeigen lassen.
Mit Outlook 2000 kein Problem:

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Mail('mail@test.de', 'Betreff');
end;



procedure TForm1.Mail(const aRecipient, aSubject: String);
  const
  olMailItem = 0;
  cRTFText = '{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl'  +
             '{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}'+
             '{\f2\froman Times New Roman;}}{\colortbl\red0\green0\blue0;}'+
             '\deflang1031\horzdoc{\*\fchars }{\*\lchars }\pard\plain\f2\fs20 '+
             ' Hier kommt ein \plain\f2\fs24\b formatiertert\plain\f2\fs20 '+
             ' Text.\par }';
  var
    MyOutlook : Olevariant;
    MyMail : Olevariant;
  begin
    try
      MyOutlook := CreateOLEObject('Outlook.Application');
      MyMail := MyOutlook.CreateItem(olMailItem) ;

      MyMail.To := aRecipient;
      MyMail.Subject := aSubject;

      MyMail.Display;

      MyMail.Body := cRTFText;

      MyOutlook := UnAssigned;
      MyMail := UnAssigned;

    except
      on E: Exception do
      begin
        MessageDlg(E.Message, mtError, [mbOk], 0);
      end;
  end;
end;
Unter Outlook 2003 bekomme ich jetzt den unveränderten Inhalt von cRTFText angezeigt.
Weiß jemand, wie es funktioniert, dass ich unter Outlook 2003 auch den Richtext angezeigt bekomme?

Ich suche verzweifelt nach einer Lösung.
Thomas Bachmann
  Mit Zitat antworten Zitat