Autor Beitrag
lkz633
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 136

WinXP, Suse Linux 8.2 (unter VMWare)
D7 Prof, K3 Prof
BeitragVerfasst: Mo 04.08.03 02:08 
Hallo,

kann ich einen Outlook Express Ordner in einer Schleife durchgehen, und alle Emailadressen in eine Datenbank einfuege?

Danke fuer eure Antworten

lkz633
lambruco
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100

Win 2000/2000 Server/XP
D6 Prof.
BeitragVerfasst: Mo 04.08.03 13:13 
Bin mir nicht sicher, aber ich glaube, bei Outlook Express könntest du auf Granit beissen.
Bei Outlook ist es aber ohne weiteres möglich.

_________________
Wer Rechtschreibfehler findet, kann Sie behalten
lkz633 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 136

WinXP, Suse Linux 8.2 (unter VMWare)
D7 Prof, K3 Prof
BeitragVerfasst: Mo 04.08.03 13:23 
Hi,

danke fuer deine Antwort, hast du einen ansatz fuer Outlook? Dann koennte ich diesen auch fuer express versuchen.

Gruss lkz633
neojones
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1206
Erhaltene Danke: 1



BeitragVerfasst: Mo 04.08.03 13:28 
Mit Express gehts definitiv nicht über die OLE-Schnittstelle (Also das, was bei Outlook problemlos funktioniert).

Man kann in Outlook-Express aber die Adressen in CSV-Dateien exportieren. Alternative wäre, die dbx-Dateien mal anzuschauen, ob man es da irgendwie rausbekommt.

Viele Grüße,

Matthias

_________________
Ha! Es compiliert! Wir können ausliefern!
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 04.08.03 19:06 
Ich hatte mal damit angefangen und es aber nur soweit gemacht, dass die Namen mal aufgelistet werden, aber das ist ja schonmal was, oder? :wink:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
procedure Timportform.BTconnectClick(Sender: TObject);
const
  olContactItem = 2;
var 
  I: integer; 
  MyFolder: variant; 
  OleApp: variant;
  NameSpace: variant;
begin
  { Create the Ole object.} 
  OleApp:= CreateOleObject('Outlook.Application'); 

  { Get the MAPI interface.} 
  NameSpace:= OleApp.GetNameSpace('MAPI'); 

  { Get all folders.}
  MyFolder:= NameSpace.Folders('Persönliche Ordner');

  { Empty the folders combobox.}
  cbFolders.Clear;

  { Loop over all folders...}
  for I:= 1 to MyFolder.Folders.Count do
    begin
      { If the folder contains contacts then add it to the combobox.}
      if (MyFolder.Folders.Item[I].DefaultItemType = olContactItem) then
         cbFolders.Items.Add(MyFolder.Folders.Item[I].Name);
    end;
  cbFolders.ItemIndex:=0;
  cbFoldersChange(Self);
end;

procedure Timportform.cbFoldersChange(Sender: TObject);
var
  I: integer;
  MyFolder: variant;
  CurFolder: variant;
  OleApp: variant;
  NameSpace: variant;
begin
  { Create the Ole object.}
  OleApp:= CreateOleObject('Outlook.Application');

  { Get the MAPI interface.}
  NameSpace:= OleApp.GetNameSpace('MAPI');

  { Get all folders.}
  MyFolder:= NameSpace.Folders('Persönliche Ordner');

  { Get all folders.}
  CurFolder:= MyFolder.Folders.Item(cbFolders.Items[cbFolders.ItemIndex]);

  { Empty the contacts listbox.}
  lbContacts.Clear;

  { Loop over all folders...}
  for I:= 1 to CurFolder.Items.Count do
    begin
      { If the folder contains contacts then add it to the combobox.}
      lbContacts.Items.Add(CurFolder.Items[I].FullName);
    end;
end;

In der 1. Prozedur werden die Folder aufgelistet, in der 2. wird eins ausgewählt. Spiel einfach mal ein bisschen damit rum :wink:
lkz633 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 136

WinXP, Suse Linux 8.2 (unter VMWare)
D7 Prof, K3 Prof
BeitragVerfasst: Mo 04.08.03 20:03 
Hi,

da hast du dir aber viel Muehe gemacht, danke!!

Leider kommt immer erst eine Box mit Microsoft LDAP Directory, danach bekomme ich die Fehlermeldung "Operation failed. An object could not be found".

Wo liegt das Problem?

Wenn ich das richtig sehe, funktioniert dies mit Outlook, geht es auch mit Express?

Nochmals danke

lkz633
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 04.08.03 23:36 
hmm, stimmt, das ist für Outlook, für Express weiß ichs leider net....

a propos Mühe: War keine Mühe, das hab ich so in einem meiner Programme drin :wink:
elysm
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25


D6 Enter, D6 Pers, D7 Pro
BeitragVerfasst: Di 05.08.03 07:30 
hey ich weis nich ob es dir hilft aber ich hatte da mal ne funktion gefunden und hab mir ein proggi gebastelt womit man seine email-addy´s auslesen und in eine datenbank speichern kann! es geht sowohl mit express als auch mit nur outlook, weil er auf das addressbuch zugreift.. glaub ich! ;)

guck halt mal nach .. hab grad keine zeit um dir das auseinanderzupflücken!

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:
23:
24:
25:
26:
27:
28:
29:
procedure TForm1.DBReadClick(Sender: TObject);
const
  olFolderContacts = $0000000A;
var
  outlook, NameSpace, Contacts, Contact: OleVariant;
  i: Integer;
begin
  if OpenDatabase = true then 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);

    DBEdit1.Text:=Contact.LastName;
    DBEdit2.Text:=Contact.FirstName;
    DBEdit3.Text:=Contact.Email1Address;
    DBEdit4.Text:=Contact.BusinessTelephoneNumber;
    DBEdit5.Text:=Contact.HomeTelephoneNumber;
    DBEdit6.Text:=Contact.MobileTelephoneNumber;
    DBNavigator1.BtnClick(nbInsert);
  end;
  Outlook := UnAssigned;
  DBNavigator1.BtnClick(nbFirst);
  end
  else MessageDLG ('Die Datenbank konnte nicht geöffnet werden!',mtError, [mbOK],0);
end;


wenn du den rest des quelltextes haben willst schreibs halt rein dann kann ich ihn hochladen!

gruss el..
lkz633 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 136

WinXP, Suse Linux 8.2 (unter VMWare)
D7 Prof, K3 Prof
BeitragVerfasst: Di 05.08.03 11:51 
Hi,

leider greift dieser Code auf das Addressbuch zu, und nicht auf einen Ordner.

Ich moechte aus einem Ordner alle emailadresse herauslesen

Gruss lkz633
lambruco
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100

Win 2000/2000 Server/XP
D6 Prof.
BeitragVerfasst: Di 05.08.03 16:58 
Du musst nur die Konstante ändern, dann kannst du auf alle Ordner
zugreifen.
(Obwohl, was meinst du mit Ordner ??)
Wenn Du zB.: den Posteingang meinst,
dann ist der Wert olFolderInbox=6 (findest du alles in der Outlook Hilfe);
aber das wird dir bei Outlook-Express nicht viel helfen.

Solltest du trotzdem eine Möglichkeit finden, wie man Outlook-Express
bearbeiten kann, dann poste es.

_________________
Wer Rechtschreibfehler findet, kann Sie behalten