Autor Beitrag
theo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

Win 2000, XP, Vista; Win 7
Delphi 6, 7, 2010, MSSQL, Firebird, DevExpress
BeitragVerfasst: Di 25.05.10 12:41 
Hallo!

Bei der folgenden Programmzeile bekomme ich unter Windows 7 den Fehler "Starten des Servers fehlgeschlagen":
ausblenden Delphi-Quelltext
1:
Outlook := CreateOleObject('Outlook.Application');					

Unter XP ist alles ok.

Gibt es dafür eine Grund bzw. eine Lösung?

ps. Auf beiden PC's ist Office 2003 installiert.

Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt
SmileySN
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 297

WinXP, Win7
Delphi 2010 Professional
BeitragVerfasst: Di 25.05.10 20:03 
Ich denke das eher was mit Deinem MS-Office zu tun.
Hast Du auf dem Windows 7 PC Das Outlook auch installiert und eingerichtet ?

Ich arbeite mit Windows 7 und Office 2007 und die folgenden Zeilen funktionieren problemlos.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
Procedure TForm1.btnKontakteClick(Sender: TObject);
  Const
    olFolderContacts = $0000000A;
  Var
    outlook, NameSpace, Contacts, Contact: OleVariant;
    i: Integer;
    s: String;

  Begin
    outlook := CreateOleObject('Outlook.Application');
    NameSpace := outlook.GetNameSpace('MAPI');

    Contacts := NameSpace.GetDefaultFolder(olFolderContacts);
    For i := 1 To Contacts.Items.Count Do
      Begin
        Contact := Contacts.Items.Item(i);
        s := Contact.FullName + ' <' + Contact.Email1Address + '>';
        lst1.Items.Add(s);
      End;

    outlook := UnAssigned;
  End;


oder hast Du Deine Outlook-Variable nicht als OleVariant definiert ?
theo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

Win 2000, XP, Vista; Win 7
Delphi 6, 7, 2010, MSSQL, Firebird, DevExpress
BeitragVerfasst: Di 25.05.10 20:31 
Mein Default-PC hat Win 7 64bit Ultimate und Office 2003. Mein Zweit-PC hat XP-Prof. und Office 2003.

Die Deklaration ist OK. Mein Quelltext ist analog dem deinigen. Ich habe eine Testanwendung auf beiden PC's getestet.

Du schreibst Office 2007 ist mit Win 7 OK. Kann es sein, dass Office 2003 Probleme mit Win 7 hat (Rechte oder so)? Weil ich habe auch Probleme unter Win 7 mit der MAPI32.DLL habe (selbe Anwendung mit XP ist OK).
Ich werde Office 2007 installieren und das ganze testen.
Chemiker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 194
Erhaltene Danke: 14

XP, Vista 32 Bit, Vista 64 Bit, Win 7 64 Bit, Win 10, Win 11
BDS 2006, RAD Studio 2009+C++, Delphi 13, VS 2010 Prof.
BeitragVerfasst: Di 25.05.10 20:31 
Hallo theo,

wenn Du es mit der Komponente TOutlookApplication von Delphi versuchst, gehst dann auch nicht?

Bis bald Chemiker
theo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

Win 2000, XP, Vista; Win 7
Delphi 6, 7, 2010, MSSQL, Firebird, DevExpress
BeitragVerfasst: Di 25.05.10 20:45 
Mit TOutlookApplication kommt die selbe Fehlermeldung bei:
OutlookApplication1.Connect
Chemiker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 194
Erhaltene Danke: 14

XP, Vista 32 Bit, Vista 64 Bit, Win 7 64 Bit, Win 10, Win 11
BDS 2006, RAD Studio 2009+C++, Delphi 13, VS 2010 Prof.
BeitragVerfasst: Di 25.05.10 20:55 
Hallo theo,

das deutet normalerweise darauf hin, dass kein Outlook installiert ist.
Ich habe einige Programme die mit Outlook zusammenarbeiten die sowohl unter XP / Outlook2003 als auch mit Win 7 64Bit / Outlook2007.
Bisher traten solche Fehler nicht auf.

Kannst Du denn in Outlook unter Win 7 einen Macro schreiben und ablaufen lassen?

Bis bald Chemiker
theo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

Win 2000, XP, Vista; Win 7
Delphi 6, 7, 2010, MSSQL, Firebird, DevExpress
BeitragVerfasst: Do 03.06.10 13:01 
Ich habe die Konstelation Win 7 / Outlook 2007 getestet.

Eine Verbindung zu Outlook ist möglich, aber nur wenn Outlook nicht gestartet ist. Ist das normal?