Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Betriebssysteme (https://www.delphipraxis.net/27-betriebssysteme/)
-   -   Outlook Mail versenden (https://www.delphipraxis.net/118644-outlook-mail-versenden.html)

roth 12. Aug 2008 07:55


Outlook Mail versenden
 
Guten Tag,

Ich habe folgendes Problem:

Seit der Umstellung von Office 2000 auf 2003 geht das hier nicht mehr:

Delphi-Quellcode:
function TOutlook.AddEmailItem(const AEmail, ASubject, ABody: String; AAppendSignature: Boolean = True): MailItem;
begin
  Result := FApplication.CreateItem(olMailItem) as MailItem;
  Result.To_ := AEmail;
  Result.Subject := ASubject;
  Result.GetInspector.Caption;
  Result.Body := ABody + Result.Body;
end;
es gibt den Fehler:
Zitat:

exception message : Interface not supported
Wiso kann ich seit der Umstellung auf 2003 kein solches Cast mehr machen?

Ich habe auch die neue TypeLibrary importiert.

mfg

toms 12. Aug 2008 20:03

Re: Outlook Mail versenden
 
Hallo,

Was für ein Typ ist FApplication?

Bernhard Geyer 12. Aug 2008 20:27

Re: Outlook Mail versenden
 
Wie hast du Office 2003 installiert? MS Office ist bekannt dafür das nach einem Update (vor allem wenn die alte Version noch aktiv bleibt) oft nichts geht. Besser ist es immer erst di alte Version zu deinstallieren und dann die neue zu installieren. Optimal ist es gleich den ganzen Rechner platt zu machen da oft irgendwelche Reste der alten Version Probleme bereiten (z.B. zerschossene MAPI-Schnittstelle).

roth 28. Aug 2008 15:54

Re: Outlook Mail versenden
 
FApplication : OutlookApplication;

Die Kiste ist komplett neu aufgesetzt worden...

Bernhard Geyer 28. Aug 2008 16:08

Re: Outlook Mail versenden
 
Importier mal die TLB von outlook um zu sehen ob evtl. die GUID von MailItem sich geändert hat.

BullsEye 28. Aug 2008 17:01

Re: Outlook Mail versenden
 
Vllt hilft das:

Delphi-Quellcode:
uses ShellApi;

...

procedure TForm1.Button1Click(Sender: TObject);
VAR
  Addy :String;
  Betreff: String;
  Text: String;
begin
Addy := 'test@test.de';
Betreff := 'Ich will dir ne Email schreiben!';
Text := Memo1.Text;

ShellExecute(Application.Handle, 'open',
PChar('mailto:'+Addy+'?subject='+Betreff+'&body='+Text),nil, nil, sw_shownormal);
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:59 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz