Results 1 to 1 of 1

Thread: [DELPHI] - Create New Outlook Contact

  1. #1

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    [DELPHI] - Create New Outlook Contact

    Code:
    uses
      ComObj, Outlook2000;
    
    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 := '';
      Contact.FirstName:= '';
      Contact.HomeAddressStreet:= '';
      Contact.HomeAddressCountry:= '';
      Contact.HomeAddressPostalCode:= '';
      Contact.HomeAddressCity:= '';
      Contact.HomeTelephoneNumber:= '';
      Contact.HomeFaxNumber:= '';
      Contact.Email1Address := '';
      Contact.Save;
      OutlApp:= nil;
    end;
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      NewContactItem;
    end;
    Last edited by Madboy; Jul 17th, 2005 at 05:54 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width