Outlook contacts list

Please discuss general Delphi programming topics here.

Outlook contacts list

Postby KiteK » November 27th, 2003, 4:19 pm

Hi! Actually, i'm writing program to sending e-mails, such as Outlook (This program is in API). And i found problem, i don't know, how can I get Outlook contacts list. Do you know any API procedures or functions to get this? Greetings, KiteK
KiteK
Active Member
Active Member
 
Posts: 6
Joined: November 27th, 2003, 4:05 pm

Postby Johnny_Bit » November 28th, 2003, 9:52 am

Code: Select all
const
folder_kontaktow = $0000000A;
var
Outlook, NameSpace, Kontakty, Kontakt : OleVariant;
i : Integer;
//----------------------------
Outlook := CreateOleObject('Outlook.Application');
NameSpace := Outlook.GetNameSpace('MAPI');
//----------------------------
Kontakty := NameSpace.GetDefaultFolder(folder_kontaktow);
//-------------------------------------------------
for i := 1 to Kontakty.Items.Count do
begin
Kontakt := Kontakty.Items.Item(i);
ListBox1.Items.Add(Kontakt.FullName); // Imie i Nazwisko
ListBox2.Items.AddKontakt.Email1Address ); // Adres e-mail
ListBox3.Items.Add(Kontakt.BusinessTelephoneNumber); // Numer telefonu
end;
Outlook := UnAssigned; // Zwolnienie zmiennej Outlook
//----------------------------------------------------------


possible properties of Kontakt:


Birthday
Business2TelephoneNumber
BusinessAddress
BusinessAddressCity
BusinessAddressCountry
BusinessAddressPostalCode
BusinessAddressPostOfficeBox
BusinessAddressState
BusinessAddressStreet
BusinessFaxNumber
BusinessHomePage
BusinessTelephoneNumber
CompanyAndFullName
CompanyMainTelephoneNumber
CompanyName
ComputerNetworkName
Department
Email1Address
Email1AddressType
Email1DisplayName
Email2Address
Email2AddressType
Email2DisplayName
Email3Address
Email3AddressType
Email3DisplayName
FirstName
FTPSite
FullName
FullNameAndCompany
GovernmentIDNumber
Hobby
Home2TelephoneNumber
HomeAddress
HomeAddressCity
HomeAddressCountry
HomeAddressPostalCode
HomeAddressPostOfficeBox
HomeAddressState
HomeAddressStree
HomeFaxNumber
HomeTelephoneNumber
Initials
ISDNNumber
JobTitle
Language
LastName
LastNameAndFirstName
MailingAddress
MailingAddressCity
MailingAddressCountry
MailingAddressPostalCode
MailingAddressPostOfficeBox
MailingAddressState
MailingAddressStreet
MiddleName
NickName
OfficeLocation
OrganizationalIDNumber
PersonalHomePage
PrimaryTelephoneNumber
Profession
Suffix
Title
WebPage
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby KiteK » November 28th, 2003, 5:02 pm

Hi! Thanks, Johnny_bit (why don't you reply on 4p? :P ), but this code has a mistake. This try open Outlook, and break down. Hmmm... do you know, how viruses getting an Outlook contacts list? (then Outlook is hidden, I'd like have that effect). Greentings, Kitek.
KiteK
Active Member
Active Member
 
Posts: 6
Joined: November 27th, 2003, 4:05 pm

Postby Johnny_Bit » December 1st, 2003, 5:12 am

if you want know, on 4p is article 'bout it.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 11 guests

cron