Hello:
If i'm using Delphi 2 - targeting only 32 bit platforms...
Why would I ever want to use the Delphi MAPI Interface (albeit
the simple MAPI interface) as opposed to using OLE Messaging?
Is their any limitations (performance, etc.) that are really going to
make any noticable differences?
For example, in one application, I want the user to be able to select
recipients out of an Address book. I was using the simple MAPI
interface; such as MapiLogOn(...), MapiAddress(...).
I just changed it over to use OLE messaging such as the following
function fragment:
{---- begin code fragment ---}
procedure TfrmMain.btnLookupNameClick(Sender: TObject);
var
Loop: Integer;
V, RecipColl, RecipObj: Variant;
begin
{ Create a MAPI Session: }
V:=CreateOleObject('MAPI.Session');
{ Logon to MAPI: }
try
V.Logon;
except
MessageDlg('Unable to Logon to MAPI; perhaps Cancelled.',
mtError,[mbOK],0);
Exit;
end;
{ Open address book: }
try
RecipColl:=V.AddressBook(toLabel:='Pager');
except
MessageDlg('Unable to start or use Address Book; perhaps
Cancelled.',
mtError,[mbOK],0);
Exit;
end;
{ One or more entries selected: }
if RecipColl.Count>0 then
begin
for Loop:=1 to RecipColl.Count do
begin
RecipObj:=RecipColl.Item[Loop];
ShowMessage('Selected ['+RecipObj.Name+']');
end;
end;
end;
{---- end code fragment ---}
Any info would be helpful!
------------------------------------------------------
Anything I have ever said or will ever say are my own
opinions and not necessarily those of my company.
Michael J. Loeffler
Teletrade, Inc.
mloeff...@teletrade.com
------------------------------------------------------