Dim M As mapi.Session
Dim r As Recipients
Dim r1 As Recipient
Set M = New mapi.Session
M.Logon
Set r = M.AddressBook(, "选择姓名", , , 3)
For Each r1 In r
If r1.Type = CdoTo Then Text1.Text = Text1.Text & r1.Name & "; "
If r1.Type = CdoCc Then Text2.Text = Text2.Text & r1.Name & "; "
If r1.Type = CdoBcc Then Text3.Text = Text3.Text & r1.Name & "; "
Next
M.Logoff
Dim r As Recipients
Dim r1 As Recipient
Set M = New mapi.Session
M.Logon
Set r = M.AddressBook(, "选择姓名", , , 3)
For Each r1 In r
If r1.Type = CdoTo Then Text1.Text = Text1.Text & r1.Name & "; "
If r1.Type = CdoCc Then Text2.Text = Text2.Text & r1.Name & "; "
If r1.Type = CdoBcc Then Text3.Text = Text3.Text & r1.Name & "; "
Next
M.Logoff
但找不到相关内容
也没时间看MSDN了
只能帮助UP一下
你有QQ吗?我的是183027730,希望能问你些相关问题
//uses ActiveX, ComObj;
//...
var M, r, r1: OleVariant;
var I: Integer;
begin
M := CreateOleObject('mapi.Session');
M.Logon;
r := M.AddressBook(EmptyParam, '选择姓名', EmptyParam, EmptyParam, 3);
for I := 0 to r.Count - 1 do
begin
r1 := r.item(I);
//....
end;
M.Logoff;
end;