Article View: borland.public.cppbuilder.nativeapi
Article #10223Re: Outlook
From: Ellis
Date: Thu, 06 May 2004 02:26
Date: Thu, 06 May 2004 02:26
59 lines
2801 bytes
2801 bytes
Thank you for your anwser :)
i'm sorry i didn't told you before, but i'm using Builder 5 Enterprise :s
i don't think i have the TOutlookApplication in this version of builder
can i do it anyway using Builder 5 ?
what API does the TOutlookApplication is using ?
"Colin B Maharaj" <noreply@myhost.com> a �crit dans le message de
news:40995d72$1@newsgroups.borland.com...
> If you have BCB6.0
>
> 1. Drop a TOutlookApplication component on a form.
> 2. Place a Button and a String Grid
> 3. Try this in the Button handler.
>
> NameSpacePtr pNameSpace ;
> FoldersPtr pFolders ;
> MAPIFolderPtr pFolder ;
> ItemsPtr pItems ;
> ContactItemPtr pContact;
>
> OutlookApplication1->Connect();
> pNameSpace = OutlookApplication1->GetNamespace (WideString("MAPI"));
> pFolders = pNameSpace->Folders;
> pFolder =
>
pNameSpace->GetDefaultFolder(Outlook_2k::OlDefaultFolders(olFolderContacts))
;
> pItems = pFolder->Items;
>
> int NumberOfContacts = pFolder->Items->Count ;
>
> StringGrid1->Cells[0][0] = "Name";
> StringGrid1->Cells[1][0] = "Email";
> StringGrid1->RowCount = NumberOfContacts + 1;
>
> for (int i=0; i<NumberOfContacts; i++)
> {
> if (i==0) pContact = pFolder->Items->GetFirst() ;
> else pContact = pFolder->Items->GetNext() ;
> StringGrid1->Cells[0][i+1] = pContact->FullName;
> StringGrid1->Cells[1][i+1] = pContact->Email1Address;
> }
> OutlookApplication1->Disconnect();
>
> 4. The stuff like Email1Address an so on can be go by opening outlook,
> and running the Visual Basic Editor, then looking at the object
> inspector (and online help).
>
>
> Ellis wrote:
> > hi everybody :)
> >
> > i want to read and write to Outlook's address book from my application,
> > how can i do this ?
> >
> > Ellis
> >
> >
Technical Details
Message-ID:
<4099a24e@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4099407c$1@newsgroups.borland.com> <40995d72$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10cc67,2a3b2df0edf4f9e2 X-Google-Attributes: gid10cc67,public From: "Ellis" <ellis.antaya@integratik.qc.ca> Newsgroups: borland.public.cppbuilder.nativeapi References: <4099407c$1@newsgroups.borland.com> <40995d72$1@newsgroups.borland.com> Subject: Re: Outlook Date: Wed, 5 May 2004 22:26:18 -0400 Lines: 61 Organization: int�gratik X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 24.201.76.203 Message-ID: <4099a24e@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1083810382 24.201.76.203 (5 May 2004 19:26:22 -0700) Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail