Search This Blog

Tuesday, April 27, 2010

Get Outlook contacts using Javascript

function getOutLookContacts(){
//id contact in outlook Active X is 10
                            var Const_olFolderContacts = 10;
                            var objApp = new ActiveXObject('Outlook.Application');
                            var objNS = objApp.GetNamespace('MAPI');
                            var colContacts = objNS.GetDefaultFolder(Const_olFolderContacts).Items
                            var currentContact='';
                            var contacts='

';
                            contacts+='';
                            contacts+='';
                            for(var i=1;i<=colContacts.count;i++){
                                var v = colContacts.item(i);
                                contacts+='';
                                contacts+='
';
                                contacts+='';
                                contacts+='';
                            }
                            contacts+='
NameE-mailtd>
>'+v["FullName"]+''+v["Email1Address"]+'
';
                        
                            return contacts;
                        }


Feel free to ask Questions 

No comments:

Post a Comment