whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1548)

Database (90)
Files (137)
Forms (107)
Graphic (116)
IDE (21)
Indy (5)
Internet / LAN (131)
IntraWeb (0)
Math (76)
Misc (127)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (268)
VCL (243)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

22 Visitors Online


 
...create a new Outlook contact item?
Autor: Katja Hoffmann
Homepage: http://www.katjahoffmann.gmxhome.de
[ Print tip ]  

Tip Rating (4):  
     


{
  Dieser Tip arbeitet mit D5/D6 und mit Outlook 2000 oder Outlook 98
  This Tip works with D5/D6, with Outlook 2000 or Outlook 98
}

{$IFDEF SYN_COMPILER_6}
uses
  
ComObj, Outlook2000;
{$ELSE}
uses
  
ComObj, Outlook8;
{$ENDIF}

procedure NewContactItem;
var
  
OutlApp: OutlookApplication;
  OutlNamespace: Namespace;
  ContactFolder: MAPIFolder;
  Contact: ContactItem;
begin
  
OutlApp := CoOutlookApplication.Create;
  OutlNamespace := OutlApp.GetNameSpace('MAPI');
  ContactFolder := OutlNamespace.GetDefaultFolder(olFolderContacts);
  Contact := OutlApp.createitem(olContactItem) as ContactItem;
  Contact.LastName  := 'User';
  Contact.FirstName := 'Jack';
  Contact.HomeAddressStreet := 'Street';
  Contact.HomeAddressCountry := 'Germany';
  Contact.HomeAddressPostalCode := '12345';
  Contact.HomeAddressCity := 'City';
  Contact.HomeTelephoneNumber := '+49(0)1239/23903';
  Contact.HomeFaxNumber := '+49(0)1239/23904';
  Contact.Email1Address := 'info@user.com';
  Contact.Save;
  OutlApp := nil;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  
NewContactItem;
end;


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners