A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

MAPI



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 20th 07, 12:17 PM posted to microsoft.public.outlook.program_vba
Vadivu
external usenet poster
 
Posts: 3
Default MAPI

Hi,
I want to use MAPI to retrieve the details from Global Address Book .
When I give MAPI.Session, it gave me an Error:"Active-x Component can't
create the object".
I tried to know MAPI32.dll was registered Properly.In command Prompt I gave
regsvr32 MAPI32.dll after giving the path details from C:\.
It said "MAPI32.dll was loaded.But the DllRegisterServer Entry point was
not Found.This file cannot be registered" .
I tried again after installing new MicrosoftOffice setup.
But even after that also, I got that same Message.
So, Whenever I try to use MAPI.Session in my Program,It is telling "Active-x
component can't create the object".
Could you please tell me the solution for this?

Regards,
Vadivu
Ads
  #2  
Old November 20th 07, 01:54 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default MAPI

MAPI.Session is not MAPI32.DLL. It's cdo.dll. CDO is an optional component for installations of Outlook 2003 and earlier and must be downloaded and installed if you want to use it in Outlook 2007.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Vadivu" wrote in message ...
Hi,
I want to use MAPI to retrieve the details from Global Address Book ..
When I give MAPI.Session, it gave me an Error:"Active-x Component can't
create the object".
I tried to know MAPI32.dll was registered Properly.In command Prompt I gave
regsvr32 MAPI32.dll after giving the path details from C:\.
It said "MAPI32.dll was loaded.But the DllRegisterServer Entry point was
not Found.This file cannot be registered" .
I tried again after installing new MicrosoftOffice setup.
But even after that also, I got that same Message.
So, Whenever I try to use MAPI.Session in my Program,It is telling "Active-x
component can't create the object".
Could you please tell me the solution for this?

Regards,
Vadivu

  #3  
Old November 21st 07, 08:25 AM posted to microsoft.public.outlook.program_vba
Vadivu
external usenet poster
 
Posts: 3
Default MAPI

Hello Sue,
Yes.I got it.I can get the details from GAL now using this.Thank you.
I have another Question regarding GAL update.
This is my Program:
Const CdoPR_GIVEN_NAME = &H3A06001E
Const CdoPR_ENTRYID = &HFFF0102
Const CdoPR_DISPLAY_NAME =&H3001001E
Const CdoPR_TITLE = &H3A17001E
Const CdoPR_COMPANY_NAME =&H3A16001E
Const CdoPR_DEPARTMENT_NAME =&H3A18001E
Const CdoPR_OFFICE_LOCATION =&H3A19001E
Const CdoPR_BUSINESS_TELEPHONE_NUMBER =&H3A08001E
Const CdoPR_MOBILE_TELEPHONE_NUMBER = &H3A1C001E
Const CdoPR_STREET_ADDRESS =&H3A29001E
Const CdoPR_LOCALITY = &H3A27001E
Const CdoPR_POSTAL_CODE =&H3A2A001E
Const CdoPR_BUSINESS2_TELEPHONE_NUMBER =&H3A1B001E
Const CdoPR_PRIMARY_FAX_NUMBER =&H3A23001E
Const CdoPR_EMAIL=&H39FE001E
Const strServer = "MyServer"
Const strMailbox = "MyMailbox"
Dim strProfileInfo
strProfileInfo = strServer & vbLf & strMailbox

Set session = CreateObject("MAPI.Session")
Session.Logon , , False, False, , True, strProfileInfo
MsgBox(session.currentuser & " " &"Logged In")
'set AddrList = Session.AddressBook.AddressLists.Item("Global Address
List")
set AddrList = Session.AddressLists.Item("Global Address List")
MsgBox "There are " & AddrList.AddressEntries.Count & " items in the GAL"

Set objAddressEntries = AddrList.AddressEntries
int i=0

For Each objAddressEntry In objAddressEntries

on error resume next
Set objAddressFields = objAddressEntry.Fields

If Not objAddressFields is Nothing Then

WriteLog ("Name : " & " " & objAddressEntry.Name & "||" & " " & "Manager
:" & " " & objAddressEntry.Manager &"||" & " "&"JobTitle :" & " " &
objAddressEntry.Fields(CdoPR_TITLE) &"||" &" " & "Company :" & " " &
objAddressEntry.Fields(CdoPR_COMPANY_NAME) &"||" & " " &"Department :" & " "
& objAddressEntry.Fields(CdoPR_DEPARTMENT_NAME)&"||" & " " & "Office :" & " "
& objAddressEntry.Fields(CdoPR_OFFICE_LOCATION)&"||" & " "&"Phone :" & " " &
objAddressEntry.Fields(CdoPR_BUSINESS_TELEPHONE_NU MBER)&"||" & " " & "Address
:" & " " & objAddressEntry.Fields(CdoPR_STREET_ADDRESS)&"||" & " "&"City :" &
" " & objAddressEntry.Fields(CdoPR_LOCALITY) &"||" & " "&"ZipCode :" & " " &
objAddressEntry.Fields(CdoPR_POSTAL_CODE)&"||" & " "&"Fax :" & " " &
objAddressEntry.Fields(CdoPR_PRIMARY_FAX_NUMBER) &"||" & " " &"E-Mail :" & "
" & objAddressEntry.Fields(CdoPR_EMAIL))
'WriteLog ("Name : " & " " & objAddressEntry.Name & "||" & " " & "Manager
:" & " " & objAddressEntry.Manager &"||" & " "&"JobTitle :" & " " &
objAddressEntry.Fields(CdoPR_TITLE) &"||" &" " & "Company :" & " " &
objAddressEntry.Fields(CdoPR_COMPANY_NAME) &"||" & " " &"Department :" & " "
& objAddressEntry.Fields(CdoPR_DEPARTMENT_NAME) &"||" & " " & "Office :" & "
" & objAddressEntry.Fields(CdoPR_OFFICE_LOCATION) &"||" & " "&"Phone :" & " "
& objAddressEntry.Fields(CdoPR_BUSINESS_TELEPHONE_NU MBER) &"||" & " "
&"Mobile :" & " " & objAddressEntry.Fields(CdoPR_MOBILE_TELEPHONE_NUMB ER)
&"||" & " " & "Address :" & " " &
objAddressEntry.Fields(CdoPR_STREET_ADDRESS) &"||" & " "&"City :" & " " &
objAddressEntry.Fields(CdoPR_LOCALITY) &"||" & " "&"ZipCode :" & " " &
objAddressEntry.Fields(CdoPR_POSTAL_CODE) &"||" & " " &"Business Phone :" & "
" & objAddressEntry.Fields(CdoPR_BUSINESS2_TELEPHONE_N UMBER) &"||" & " "&"Fax
:" & " " & objAddressEntry.Fields(CdoPR_PRIMARY_FAX_NUMBER) &"||" & " "
&"E-Mail :" & " " & objAddressEntry.Fields(CdoPR_EMAIL))

if(objAddressEntry.Name ="Vadivukarasi Kumaresan") Then
MsgBox("Found :" & objAddressEntry.Name)
objAddressEntry.Name = "Vadivu"
objAddressEntry.Save
MsgBox("Changed Name: " & objAddressEntry.Name)
end if
End If
Next

I used My credentials for Servername and Mailbox which I have not shown
here.My name is included in Admin Group who have all rights to change
GAL.Here I tried to Change my name from "Vadivukarasi Kumaresan"
to"Vadivu".While running this Script, I can see the change of Name.But it is
not reflecting in Address Book.Could you please help me?

Regards,
Vadivu
"Sue Mosher [MVP-Outlook]" wrote:

MAPI.Session is not MAPI32.DLL. It's cdo.dll. CDO is an optional component for installations of Outlook 2003 and earlier and must be downloaded and installed if you want to use it in Outlook 2007.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Vadivu" wrote in message ...
Hi,
I want to use MAPI to retrieve the details from Global Address Book ..
When I give MAPI.Session, it gave me an Error:"Active-x Component can't
create the object".
I tried to know MAPI32.dll was registered Properly.In command Prompt I gave
regsvr32 MAPI32.dll after giving the path details from C:\.
It said "MAPI32.dll was loaded.But the DllRegisterServer Entry point was
not Found.This file cannot be registered" .
I tried again after installing new MicrosoftOffice setup.
But even after that also, I got that same Message.
So, Whenever I try to use MAPI.Session in my Program,It is telling "Active-x
component can't create the object".
Could you please tell me the solution for this?

Regards,
Vadivu


  #4  
Old November 21st 07, 02:15 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default MAPI

IIRC, you can't change GAL entries using CDO, but you could use ADSI for that.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Vadivu" wrote in message ...
Hello Sue,
Yes.I got it.I can get the details from GAL now using this.Thank you.
I have another Question regarding GAL update.
This is my Program:
Const CdoPR_GIVEN_NAME = &H3A06001E
Const CdoPR_ENTRYID = &HFFF0102
Const CdoPR_DISPLAY_NAME =&H3001001E
Const CdoPR_TITLE = &H3A17001E
Const CdoPR_COMPANY_NAME =&H3A16001E
Const CdoPR_DEPARTMENT_NAME =&H3A18001E
Const CdoPR_OFFICE_LOCATION =&H3A19001E
Const CdoPR_BUSINESS_TELEPHONE_NUMBER =&H3A08001E
Const CdoPR_MOBILE_TELEPHONE_NUMBER = &H3A1C001E
Const CdoPR_STREET_ADDRESS =&H3A29001E
Const CdoPR_LOCALITY = &H3A27001E
Const CdoPR_POSTAL_CODE =&H3A2A001E
Const CdoPR_BUSINESS2_TELEPHONE_NUMBER =&H3A1B001E
Const CdoPR_PRIMARY_FAX_NUMBER =&H3A23001E
Const CdoPR_EMAIL=&H39FE001E
Const strServer = "MyServer"
Const strMailbox = "MyMailbox"
Dim strProfileInfo
strProfileInfo = strServer & vbLf & strMailbox

Set session = CreateObject("MAPI.Session")
Session.Logon , , False, False, , True, strProfileInfo
MsgBox(session.currentuser & " " &"Logged In")
'set AddrList = Session.AddressBook.AddressLists.Item("Global Address
List")
set AddrList = Session.AddressLists.Item("Global Address List")
MsgBox "There are " & AddrList.AddressEntries.Count & " items in the GAL"

Set objAddressEntries = AddrList.AddressEntries
int i=0

For Each objAddressEntry In objAddressEntries

on error resume next
Set objAddressFields = objAddressEntry.Fields

If Not objAddressFields is Nothing Then

WriteLog ("Name : " & " " & objAddressEntry.Name & "||" & " " & "Manager
:" & " " & objAddressEntry.Manager &"||" & " "&"JobTitle :" & " " &
objAddressEntry.Fields(CdoPR_TITLE) &"||" &" " & "Company :" & " " &
objAddressEntry.Fields(CdoPR_COMPANY_NAME) &"||" & " " &"Department :" & " "
& objAddressEntry.Fields(CdoPR_DEPARTMENT_NAME)&"||" & " " & "Office :" & " "
& objAddressEntry.Fields(CdoPR_OFFICE_LOCATION)&"||" & " "&"Phone :" & " " &
objAddressEntry.Fields(CdoPR_BUSINESS_TELEPHONE_NU MBER)&"||" & " " & "Address
:" & " " & objAddressEntry.Fields(CdoPR_STREET_ADDRESS)&"||" & " "&"City :" &
" " & objAddressEntry.Fields(CdoPR_LOCALITY) &"||" & " "&"ZipCode :" & " " &
objAddressEntry.Fields(CdoPR_POSTAL_CODE)&"||" & " "&"Fax :" & " " &
objAddressEntry.Fields(CdoPR_PRIMARY_FAX_NUMBER) &"||" & " " &"E-Mail :" & "
" & objAddressEntry.Fields(CdoPR_EMAIL))
'WriteLog ("Name : " & " " & objAddressEntry.Name & "||" & " " & "Manager
:" & " " & objAddressEntry.Manager &"||" & " "&"JobTitle :" & " " &
objAddressEntry.Fields(CdoPR_TITLE) &"||" &" " & "Company :" & " " &
objAddressEntry.Fields(CdoPR_COMPANY_NAME) &"||" & " " &"Department :" & " "
& objAddressEntry.Fields(CdoPR_DEPARTMENT_NAME) &"||" & " " & "Office :" & "
" & objAddressEntry.Fields(CdoPR_OFFICE_LOCATION) &"||" & " "&"Phone :" & " "
& objAddressEntry.Fields(CdoPR_BUSINESS_TELEPHONE_NU MBER) &"||" & " "
&"Mobile :" & " " & objAddressEntry.Fields(CdoPR_MOBILE_TELEPHONE_NUMB ER)
&"||" & " " & "Address :" & " " &
objAddressEntry.Fields(CdoPR_STREET_ADDRESS) &"||" & " "&"City :" & " " &
objAddressEntry.Fields(CdoPR_LOCALITY) &"||" & " "&"ZipCode :" & " " &
objAddressEntry.Fields(CdoPR_POSTAL_CODE) &"||" & " " &"Business Phone :" & "
" & objAddressEntry.Fields(CdoPR_BUSINESS2_TELEPHONE_N UMBER) &"||" & " "&"Fax
:" & " " & objAddressEntry.Fields(CdoPR_PRIMARY_FAX_NUMBER) &"||" & " "
&"E-Mail :" & " " & objAddressEntry.Fields(CdoPR_EMAIL))

if(objAddressEntry.Name ="Vadivukarasi Kumaresan") Then
MsgBox("Found :" & objAddressEntry.Name)
objAddressEntry.Name = "Vadivu"
objAddressEntry.Save
MsgBox("Changed Name: " & objAddressEntry.Name)
end if
End If
Next

I used My credentials for Servername and Mailbox which I have not shown
here.My name is included in Admin Group who have all rights to change
GAL.Here I tried to Change my name from "Vadivukarasi Kumaresan"
to"Vadivu".While running this Script, I can see the change of Name.But it is
not reflecting in Address Book.Could you please help me?

Regards,
Vadivu
"Sue Mosher [MVP-Outlook]" wrote:

MAPI.Session is not MAPI32.DLL. It's cdo.dll. CDO is an optional component for installations of Outlook 2003 and earlier and must be downloaded and installed if you want to use it in Outlook 2007.

"Vadivu" wrote in message ...
Hi,
I want to use MAPI to retrieve the details from Global Address Book ..
When I give MAPI.Session, it gave me an Error:"Active-x Component can't
create the object".
I tried to know MAPI32.dll was registered Properly.In command Prompt I gave
regsvr32 MAPI32.dll after giving the path details from C:\.
It said "MAPI32.dll was loaded.But the DllRegisterServer Entry point was
not Found.This file cannot be registered" .
I tried again after installing new MicrosoftOffice setup.
But even after that also, I got that same Message.
So, Whenever I try to use MAPI.Session in my Program,It is telling "Active-x
component can't create the object".
Could you please tell me the solution for this?

Regards,
Vadivu


  #5  
Old November 26th 07, 10:35 AM posted to microsoft.public.outlook.program_vba
Vadivu
external usenet poster
 
Posts: 3
Default MAPI

Hi,
Thanks for your Guidance so far.
I tried to connect to ADSI, using this Command, using vb.net
I added refereces "Active DS" and LDAPAUTH lib.

Dim AddressListCont = GetObject("LDAP://Myserver/CN=All Global Address
Lists,CN=Address Lists Container,CN=MyOrg,CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=MyDomain, DC=com")

But it shows me the Error:" Cannot create Active X Component"

Which dll should I add to this Program?
Can you please give some sample program to work with Global Address List?
I'll be thankful to you if I can successfully update GAL .

REgards,
Vadivu


"Sue Mosher [MVP-Outlook]" wrote:

IIRC, you can't change GAL entries using CDO, but you could use ADSI for that.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Vadivu" wrote in message ...
Hello Sue,
Yes.I got it.I can get the details from GAL now using this.Thank you.
I have another Question regarding GAL update.
This is my Program:
Const CdoPR_GIVEN_NAME = &H3A06001E
Const CdoPR_ENTRYID = &HFFF0102
Const CdoPR_DISPLAY_NAME =&H3001001E
Const CdoPR_TITLE = &H3A17001E
Const CdoPR_COMPANY_NAME =&H3A16001E
Const CdoPR_DEPARTMENT_NAME =&H3A18001E
Const CdoPR_OFFICE_LOCATION =&H3A19001E
Const CdoPR_BUSINESS_TELEPHONE_NUMBER =&H3A08001E
Const CdoPR_MOBILE_TELEPHONE_NUMBER = &H3A1C001E
Const CdoPR_STREET_ADDRESS =&H3A29001E
Const CdoPR_LOCALITY = &H3A27001E
Const CdoPR_POSTAL_CODE =&H3A2A001E
Const CdoPR_BUSINESS2_TELEPHONE_NUMBER =&H3A1B001E
Const CdoPR_PRIMARY_FAX_NUMBER =&H3A23001E
Const CdoPR_EMAIL=&H39FE001E
Const strServer = "MyServer"
Const strMailbox = "MyMailbox"
Dim strProfileInfo
strProfileInfo = strServer & vbLf & strMailbox

Set session = CreateObject("MAPI.Session")
Session.Logon , , False, False, , True, strProfileInfo
MsgBox(session.currentuser & " " &"Logged In")
'set AddrList = Session.AddressBook.AddressLists.Item("Global Address
List")
set AddrList = Session.AddressLists.Item("Global Address List")
MsgBox "There are " & AddrList.AddressEntries.Count & " items in the GAL"

Set objAddressEntries = AddrList.AddressEntries
int i=0

For Each objAddressEntry In objAddressEntries

on error resume next
Set objAddressFields = objAddressEntry.Fields

If Not objAddressFields is Nothing Then

WriteLog ("Name : " & " " & objAddressEntry.Name & "||" & " " & "Manager
:" & " " & objAddressEntry.Manager &"||" & " "&"JobTitle :" & " " &
objAddressEntry.Fields(CdoPR_TITLE) &"||" &" " & "Company :" & " " &
objAddressEntry.Fields(CdoPR_COMPANY_NAME) &"||" & " " &"Department :" & " "
& objAddressEntry.Fields(CdoPR_DEPARTMENT_NAME)&"||" & " " & "Office :" & " "
& objAddressEntry.Fields(CdoPR_OFFICE_LOCATION)&"||" & " "&"Phone :" & " " &
objAddressEntry.Fields(CdoPR_BUSINESS_TELEPHONE_NU MBER)&"||" & " " & "Address
:" & " " & objAddressEntry.Fields(CdoPR_STREET_ADDRESS)&"||" & " "&"City :" &
" " & objAddressEntry.Fields(CdoPR_LOCALITY) &"||" & " "&"ZipCode :" & " " &
objAddressEntry.Fields(CdoPR_POSTAL_CODE)&"||" & " "&"Fax :" & " " &
objAddressEntry.Fields(CdoPR_PRIMARY_FAX_NUMBER) &"||" & " " &"E-Mail :" & "
" & objAddressEntry.Fields(CdoPR_EMAIL))
'WriteLog ("Name : " & " " & objAddressEntry.Name & "||" & " " & "Manager
:" & " " & objAddressEntry.Manager &"||" & " "&"JobTitle :" & " " &
objAddressEntry.Fields(CdoPR_TITLE) &"||" &" " & "Company :" & " " &
objAddressEntry.Fields(CdoPR_COMPANY_NAME) &"||" & " " &"Department :" & " "
& objAddressEntry.Fields(CdoPR_DEPARTMENT_NAME) &"||" & " " & "Office :" & "
" & objAddressEntry.Fields(CdoPR_OFFICE_LOCATION) &"||" & " "&"Phone :" & " "
& objAddressEntry.Fields(CdoPR_BUSINESS_TELEPHONE_NU MBER) &"||" & " "
&"Mobile :" & " " & objAddressEntry.Fields(CdoPR_MOBILE_TELEPHONE_NUMB ER)
&"||" & " " & "Address :" & " " &
objAddressEntry.Fields(CdoPR_STREET_ADDRESS) &"||" & " "&"City :" & " " &
objAddressEntry.Fields(CdoPR_LOCALITY) &"||" & " "&"ZipCode :" & " " &
objAddressEntry.Fields(CdoPR_POSTAL_CODE) &"||" & " " &"Business Phone :" & "
" & objAddressEntry.Fields(CdoPR_BUSINESS2_TELEPHONE_N UMBER) &"||" & " "&"Fax
:" & " " & objAddressEntry.Fields(CdoPR_PRIMARY_FAX_NUMBER) &"||" & " "
&"E-Mail :" & " " & objAddressEntry.Fields(CdoPR_EMAIL))

if(objAddressEntry.Name ="Vadivukarasi Kumaresan") Then
MsgBox("Found :" & objAddressEntry.Name)
objAddressEntry.Name = "Vadivu"
objAddressEntry.Save
MsgBox("Changed Name: " & objAddressEntry.Name)
end if
End If
Next

I used My credentials for Servername and Mailbox which I have not shown
here.My name is included in Admin Group who have all rights to change
GAL.Here I tried to Change my name from "Vadivukarasi Kumaresan"
to"Vadivu".While running this Script, I can see the change of Name.But it is
not reflecting in Address Book.Could you please help me?

Regards,
Vadivu
"Sue Mosher [MVP-Outlook]" wrote:

MAPI.Session is not MAPI32.DLL. It's cdo.dll. CDO is an optional component for installations of Outlook 2003 and earlier and must be downloaded and installed if you want to use it in Outlook 2007.

"Vadivu" wrote in message ...
Hi,
I want to use MAPI to retrieve the details from Global Address Book ..
When I give MAPI.Session, it gave me an Error:"Active-x Component can't
create the object".
I tried to know MAPI32.dll was registered Properly.In command Prompt I gave
regsvr32 MAPI32.dll after giving the path details from C:\.
It said "MAPI32.dll was loaded.But the DllRegisterServer Entry point was
not Found.This file cannot be registered" .
I tried again after installing new MicrosoftOffice setup.
But even after that also, I got that same Message.
So, Whenever I try to use MAPI.Session in my Program,It is telling "Active-x
component can't create the object".
Could you please tell me the solution for this?

Regards,
Vadivu


  #6  
Old November 26th 07, 04:59 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default MAPI

This looks like a good article with sample code: http://www.msexchange.org/articles/S...SI-Part1..html. The newsgroup to use for ADSI programming questions would be microsoft.public.platformsdk.adsi.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Vadivu" wrote in message news
Hi,
Thanks for your Guidance so far.
I tried to connect to ADSI, using this Command, using vb.net
I added refereces "Active DS" and LDAPAUTH lib.

Dim AddressListCont = GetObject("LDAP://Myserver/CN=All Global Address
Lists,CN=Address Lists Container,CN=MyOrg,CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=MyDomain, DC=com")

But it shows me the Error:" Cannot create Active X Component"

Which dll should I add to this Program?
Can you please give some sample program to work with Global Address List?
I'll be thankful to you if I can successfully update GAL .


"Sue Mosher [MVP-Outlook]" wrote:

IIRC, you can't change GAL entries using CDO, but you could use ADSI for that.



"Vadivu" wrote in message ...
Hello Sue,
Yes.I got it.I can get the details from GAL now using this.Thank you.
I have another Question regarding GAL update.
This is my Program:
Const CdoPR_GIVEN_NAME = &H3A06001E
Const CdoPR_ENTRYID = &HFFF0102
Const CdoPR_DISPLAY_NAME =&H3001001E
Const CdoPR_TITLE = &H3A17001E
Const CdoPR_COMPANY_NAME =&H3A16001E
Const CdoPR_DEPARTMENT_NAME =&H3A18001E
Const CdoPR_OFFICE_LOCATION =&H3A19001E
Const CdoPR_BUSINESS_TELEPHONE_NUMBER =&H3A08001E
Const CdoPR_MOBILE_TELEPHONE_NUMBER = &H3A1C001E
Const CdoPR_STREET_ADDRESS =&H3A29001E
Const CdoPR_LOCALITY = &H3A27001E
Const CdoPR_POSTAL_CODE =&H3A2A001E
Const CdoPR_BUSINESS2_TELEPHONE_NUMBER =&H3A1B001E
Const CdoPR_PRIMARY_FAX_NUMBER =&H3A23001E
Const CdoPR_EMAIL=&H39FE001E
Const strServer = "MyServer"
Const strMailbox = "MyMailbox"
Dim strProfileInfo
strProfileInfo = strServer & vbLf & strMailbox

Set session = CreateObject("MAPI.Session")
Session.Logon , , False, False, , True, strProfileInfo
MsgBox(session.currentuser & " " &"Logged In")
'set AddrList = Session.AddressBook.AddressLists.Item("Global Address
List")
set AddrList = Session.AddressLists.Item("Global Address List")
MsgBox "There are " & AddrList.AddressEntries.Count & " items in the GAL"

Set objAddressEntries = AddrList.AddressEntries
int i=0

For Each objAddressEntry In objAddressEntries

on error resume next
Set objAddressFields = objAddressEntry.Fields

If Not objAddressFields is Nothing Then

WriteLog ("Name : " & " " & objAddressEntry.Name & "||" & " " & "Manager
:" & " " & objAddressEntry.Manager &"||" & " "&"JobTitle :" & " " &
objAddressEntry.Fields(CdoPR_TITLE) &"||" &" " & "Company :" & " " &
objAddressEntry.Fields(CdoPR_COMPANY_NAME) &"||" & " " &"Department :" & " "
& objAddressEntry.Fields(CdoPR_DEPARTMENT_NAME)&"||" & " " & "Office :" & " "
& objAddressEntry.Fields(CdoPR_OFFICE_LOCATION)&"||" & " "&"Phone :" & " " &
objAddressEntry.Fields(CdoPR_BUSINESS_TELEPHONE_NU MBER)&"||" & " " & "Address
:" & " " & objAddressEntry.Fields(CdoPR_STREET_ADDRESS)&"||" & " "&"City :" &
" " & objAddressEntry.Fields(CdoPR_LOCALITY) &"||" & " "&"ZipCode :" & " " &
objAddressEntry.Fields(CdoPR_POSTAL_CODE)&"||" & " "&"Fax :" & " " &
objAddressEntry.Fields(CdoPR_PRIMARY_FAX_NUMBER) &"||" & " " &"E-Mail :" & "
" & objAddressEntry.Fields(CdoPR_EMAIL))
'WriteLog ("Name : " & " " & objAddressEntry.Name & "||" & " " & "Manager
:" & " " & objAddressEntry.Manager &"||" & " "&"JobTitle :" & " " &
objAddressEntry.Fields(CdoPR_TITLE) &"||" &" " & "Company :" & " " &
objAddressEntry.Fields(CdoPR_COMPANY_NAME) &"||" & " " &"Department :" & " "
& objAddressEntry.Fields(CdoPR_DEPARTMENT_NAME) &"||" & " " & "Office :" & "
" & objAddressEntry.Fields(CdoPR_OFFICE_LOCATION) &"||" & " "&"Phone :" & " "
& objAddressEntry.Fields(CdoPR_BUSINESS_TELEPHONE_NU MBER) &"||" & " "
&"Mobile :" & " " & objAddressEntry.Fields(CdoPR_MOBILE_TELEPHONE_NUMB ER)
&"||" & " " & "Address :" & " " &
objAddressEntry.Fields(CdoPR_STREET_ADDRESS) &"||" & " "&"City :" & " " &
objAddressEntry.Fields(CdoPR_LOCALITY) &"||" & " "&"ZipCode :" & " " &
objAddressEntry.Fields(CdoPR_POSTAL_CODE) &"||" & " " &"Business Phone :" & "
" & objAddressEntry.Fields(CdoPR_BUSINESS2_TELEPHONE_N UMBER) &"||" & " "&"Fax
:" & " " & objAddressEntry.Fields(CdoPR_PRIMARY_FAX_NUMBER) &"||" & " "
&"E-Mail :" & " " & objAddressEntry.Fields(CdoPR_EMAIL))

if(objAddressEntry.Name ="Vadivukarasi Kumaresan") Then
MsgBox("Found :" & objAddressEntry.Name)
objAddressEntry.Name = "Vadivu"
objAddressEntry.Save
MsgBox("Changed Name: " & objAddressEntry.Name)
end if
End If
Next

I used My credentials for Servername and Mailbox which I have not shown
here.My name is included in Admin Group who have all rights to change
GAL.Here I tried to Change my name from "Vadivukarasi Kumaresan"
to"Vadivu".While running this Script, I can see the change of Name.But it is
not reflecting in Address Book.Could you please help me?

Regards,
Vadivu
"Sue Mosher [MVP-Outlook]" wrote:

MAPI.Session is not MAPI32.DLL. It's cdo.dll. CDO is an optional component for installations of Outlook 2003 and earlier and must be downloaded and installed if you want to use it in Outlook 2007.

"Vadivu" wrote in message ...
Hi,
I want to use MAPI to retrieve the details from Global Address Book ..
When I give MAPI.Session, it gave me an Error:"Active-x Component can't
create the object".
I tried to know MAPI32.dll was registered Properly.In command Prompt I gave
regsvr32 MAPI32.dll after giving the path details from C:\.
It said "MAPI32.dll was loaded.But the DllRegisterServer Entry point was
not Found.This file cannot be registered" .
I tried again after installing new MicrosoftOffice setup.
But even after that also, I got that same Message.
So, Whenever I try to use MAPI.Session in my Program,It is telling "Active-x
component can't create the object".
Could you please tell me the solution for this?

Regards,
Vadivu


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mapi could not be opened No Name Outlook - General Queries 12 November 30th 07 08:20 PM
CDO / MAPI in C++ Andrew Wan Outlook - General Queries 2 January 9th 07 09:17 PM
MAPI Error Francesco Outlook - General Queries 1 January 1st 07 04:53 AM
Mapi Rebekah Outlook and VBA 0 September 27th 06 10:23 PM
How to use MAPI with an ISP RGR. Jim Outlook - Installation 2 February 1st 06 08:57 PM


All times are GMT +1. The time now is 12:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.