![]() |
Microsoft CDO 1.21 library
Good day.
I am designing an Excel solution that will require CDO 1.21 library. How can I be sure each user has this installed, and if they are using Excel 2000 or less, how can I install it for them via code or an intall routine. Thanks, |
Microsoft CDO 1.21 library
The CDO library is part of the Outlook install. If it is not installed then
you need to get it installed (you need the office disk and the necessary permissions to perform an install on the host computer). I did some developement with CDO but ended up abandoning it because of just these kind of issues. Also note that CDO operates differently on 2000 depending on what service pack is installed (extra security prompts the user for approvals and such). -- HTH... Jim Thomlinson "Steve" wrote: Good day. I am designing an Excel solution that will require CDO 1.21 library. How can I be sure each user has this installed, and if they are using Excel 2000 or less, how can I install it for them via code or an intall routine. Thanks, |
Microsoft CDO 1.21 library
What are the other options if I want to call Outlook from Excel. I would
need to get email addresses from Outlook and things of that nature. Also, is it ok to load CDO.dll on the users computers? It seems that is the only file missing, and when I copied CDO.dll from my computer to another one of my computers it seemed to work then.. Is it necessary to install from the CD. "Jim Thomlinson" wrote: The CDO library is part of the Outlook install. If it is not installed then you need to get it installed (you need the office disk and the necessary permissions to perform an install on the host computer). I did some developement with CDO but ended up abandoning it because of just these kind of issues. Also note that CDO operates differently on 2000 depending on what service pack is installed (extra security prompts the user for approvals and such). -- HTH... Jim Thomlinson "Steve" wrote: Good day. I am designing an Excel solution that will require CDO 1.21 library. How can I be sure each user has this installed, and if they are using Excel 2000 or less, how can I install it for them via code or an intall routine. Thanks, |
Microsoft CDO 1.21 library
You might be able to get away with just copying CDO.dll to the host computer.
That was not an option for me because of potential administrator restrictions on the host machines in terms of installing files and how to get the files sent to them in the first place. The code that I was using accessed the global address list to get e-mail addresses. When the new service pack was installed the host machine would prompt the user that a program was trying to access the Global Address list (it thought that the program might be a virus trying to e-mail). It was at this point that I abandoned the project. -- HTH... Jim Thomlinson "Steve" wrote: What are the other options if I want to call Outlook from Excel. I would need to get email addresses from Outlook and things of that nature. Also, is it ok to load CDO.dll on the users computers? It seems that is the only file missing, and when I copied CDO.dll from my computer to another one of my computers it seemed to work then.. Is it necessary to install from the CD. "Jim Thomlinson" wrote: The CDO library is part of the Outlook install. If it is not installed then you need to get it installed (you need the office disk and the necessary permissions to perform an install on the host computer). I did some developement with CDO but ended up abandoning it because of just these kind of issues. Also note that CDO operates differently on 2000 depending on what service pack is installed (extra security prompts the user for approvals and such). -- HTH... Jim Thomlinson "Steve" wrote: Good day. I am designing an Excel solution that will require CDO 1.21 library. How can I be sure each user has this installed, and if they are using Excel 2000 or less, how can I install it for them via code or an intall routine. Thanks, |
Microsoft CDO 1.21 library
Here is the code I was working on if it helps at all
Option Explicit Const CdoPR_EMS_AB_PROXY_ADDRESSES = &H800F101E Const g_strMAPILogOn As String = "MS Exchange Settings" Const g_strAddressList As String = "Global Address List" Const g_strEMailAddressIdentifier As String = "SMTP" Sub Test() MsgBox GetEMailAddress("James Thomlinson") End Sub Public Function GetEMailAddress(ByVal strName As String) As String Dim objSession As MAPI.Session Dim objField As MAPI.Field Dim MyAddressList As MAPI.AddressList Dim MyAddressEntries As MAPI.AddressEntries Dim MyEntry As MAPI.AddressEntry Dim SomeEntry As MAPI.AddressEntry Dim MyRecipient As MAPI.Recipient Dim v As Variant Dim strReturnValue As String 'Initialize Local Variables strReturnValue = "No Address Found" 'Retrun Value if not found ' Create Session object and Logon. Set objSession = CreateObject("MAPI.Session") objSession.Logon (g_strMAPILogOn) 'Create the Address list from the Global Address List Set MyAddressList = objSession.AddressLists(g_strAddressList) If MyAddressList Is Nothing Then MsgBox g_strAddressList & " Unavailable!", vbCritical, "Critical Error" Exit Function End If 'Initialize MyAddressEntires with the entries in the Address List Set MyAddressEntries = MyAddressList.AddressEntries 'Traverse through the entries searching for a match For Each SomeEntry In MyAddressEntries Set MyEntry = SomeEntry If Trim(UCase(strName)) = Trim(UCase(MyEntry.Name)) Then Set objField = MyEntry.Fields(CdoPR_EMS_AB_PROXY_ADDRESSES) ' PR_EMS_AB_PROXY_ADDRESSES is a multivalued property (PT_MV_TSTRING). ' Therefore, you need to extract the individual members. For Each v In objField.Value If InStr(1, UCase(v), g_strEMailAddressIdentifier) Then strReturnValue = Mid(v, 6, 256) Exit For End If Next 'Next Field Value Exit For End If Next 'Next Address Entry 'Return Function Value GetEMailAddress = strReturnValue 'Housekeeping Set objField = Nothing Set MyAddressList = Nothing Set MyAddressEntries = Nothing Set MyEntry = Nothing Set MyRecipient = Nothing objSession.Logoff Set objSession = Nothing End Function -- HTH... Jim Thomlinson "Steve" wrote: What are the other options if I want to call Outlook from Excel. I would need to get email addresses from Outlook and things of that nature. Also, is it ok to load CDO.dll on the users computers? It seems that is the only file missing, and when I copied CDO.dll from my computer to another one of my computers it seemed to work then.. Is it necessary to install from the CD. "Jim Thomlinson" wrote: The CDO library is part of the Outlook install. If it is not installed then you need to get it installed (you need the office disk and the necessary permissions to perform an install on the host computer). I did some developement with CDO but ended up abandoning it because of just these kind of issues. Also note that CDO operates differently on 2000 depending on what service pack is installed (extra security prompts the user for approvals and such). -- HTH... Jim Thomlinson "Steve" wrote: Good day. I am designing an Excel solution that will require CDO 1.21 library. How can I be sure each user has this installed, and if they are using Excel 2000 or less, how can I install it for them via code or an intall routine. Thanks, |
Microsoft CDO 1.21 library
Ok, so as far as you know, if I can just copy the CDO.dll file to their
computer and it works, that is ok. It is legally ok to distribute the CDO.dll file if the user already has legal copies of Outlook and Excel on their computer.(I know this question may be out of your area and may not pertain to this forum) "Jim Thomlinson" wrote: You might be able to get away with just copying CDO.dll to the host computer. That was not an option for me because of potential administrator restrictions on the host machines in terms of installing files and how to get the files sent to them in the first place. The code that I was using accessed the global address list to get e-mail addresses. When the new service pack was installed the host machine would prompt the user that a program was trying to access the Global Address list (it thought that the program might be a virus trying to e-mail). It was at this point that I abandoned the project. -- HTH... Jim Thomlinson "Steve" wrote: What are the other options if I want to call Outlook from Excel. I would need to get email addresses from Outlook and things of that nature. Also, is it ok to load CDO.dll on the users computers? It seems that is the only file missing, and when I copied CDO.dll from my computer to another one of my computers it seemed to work then.. Is it necessary to install from the CD. "Jim Thomlinson" wrote: The CDO library is part of the Outlook install. If it is not installed then you need to get it installed (you need the office disk and the necessary permissions to perform an install on the host computer). I did some developement with CDO but ended up abandoning it because of just these kind of issues. Also note that CDO operates differently on 2000 depending on what service pack is installed (extra security prompts the user for approvals and such). -- HTH... Jim Thomlinson "Steve" wrote: Good day. I am designing an Excel solution that will require CDO 1.21 library. How can I be sure each user has this installed, and if they are using Excel 2000 or less, how can I install it for them via code or an intall routine. Thanks, |
Microsoft CDO 1.21 library
I can not imagine that there would be a problem with distributing the CDO
(more of a guess than a legal opionion) file since the dll is only handy for playing with Outlook. If they have Outlook then they could have installed the CDO on their own... Before you send them a copy of CDO make sure you are not overwriting a CDO file that they already have on their system... -- HTH... Jim Thomlinson "Steve" wrote: Ok, so as far as you know, if I can just copy the CDO.dll file to their computer and it works, that is ok. It is legally ok to distribute the CDO.dll file if the user already has legal copies of Outlook and Excel on their computer.(I know this question may be out of your area and may not pertain to this forum) "Jim Thomlinson" wrote: You might be able to get away with just copying CDO.dll to the host computer. That was not an option for me because of potential administrator restrictions on the host machines in terms of installing files and how to get the files sent to them in the first place. The code that I was using accessed the global address list to get e-mail addresses. When the new service pack was installed the host machine would prompt the user that a program was trying to access the Global Address list (it thought that the program might be a virus trying to e-mail). It was at this point that I abandoned the project. -- HTH... Jim Thomlinson "Steve" wrote: What are the other options if I want to call Outlook from Excel. I would need to get email addresses from Outlook and things of that nature. Also, is it ok to load CDO.dll on the users computers? It seems that is the only file missing, and when I copied CDO.dll from my computer to another one of my computers it seemed to work then.. Is it necessary to install from the CD. "Jim Thomlinson" wrote: The CDO library is part of the Outlook install. If it is not installed then you need to get it installed (you need the office disk and the necessary permissions to perform an install on the host computer). I did some developement with CDO but ended up abandoning it because of just these kind of issues. Also note that CDO operates differently on 2000 depending on what service pack is installed (extra security prompts the user for approvals and such). -- HTH... Jim Thomlinson "Steve" wrote: Good day. I am designing an Excel solution that will require CDO 1.21 library. How can I be sure each user has this installed, and if they are using Excel 2000 or less, how can I install it for them via code or an intall routine. Thanks, |
Microsoft CDO 1.21 library
Thank you Jim. Yes, it would be best to check their system for the CDO file
first. This may be tricky, but I think it is worth it. However, after Outlook 2000, the CDO.dll was installed as part of Outlook, is that correct? No need to worry about that after Office 2000? "Jim Thomlinson" wrote: Here is the code I was working on if it helps at all Option Explicit Const CdoPR_EMS_AB_PROXY_ADDRESSES = &H800F101E Const g_strMAPILogOn As String = "MS Exchange Settings" Const g_strAddressList As String = "Global Address List" Const g_strEMailAddressIdentifier As String = "SMTP" Sub Test() MsgBox GetEMailAddress("James Thomlinson") End Sub Public Function GetEMailAddress(ByVal strName As String) As String Dim objSession As MAPI.Session Dim objField As MAPI.Field Dim MyAddressList As MAPI.AddressList Dim MyAddressEntries As MAPI.AddressEntries Dim MyEntry As MAPI.AddressEntry Dim SomeEntry As MAPI.AddressEntry Dim MyRecipient As MAPI.Recipient Dim v As Variant Dim strReturnValue As String 'Initialize Local Variables strReturnValue = "No Address Found" 'Retrun Value if not found ' Create Session object and Logon. Set objSession = CreateObject("MAPI.Session") objSession.Logon (g_strMAPILogOn) 'Create the Address list from the Global Address List Set MyAddressList = objSession.AddressLists(g_strAddressList) If MyAddressList Is Nothing Then MsgBox g_strAddressList & " Unavailable!", vbCritical, "Critical Error" Exit Function End If 'Initialize MyAddressEntires with the entries in the Address List Set MyAddressEntries = MyAddressList.AddressEntries 'Traverse through the entries searching for a match For Each SomeEntry In MyAddressEntries Set MyEntry = SomeEntry If Trim(UCase(strName)) = Trim(UCase(MyEntry.Name)) Then Set objField = MyEntry.Fields(CdoPR_EMS_AB_PROXY_ADDRESSES) ' PR_EMS_AB_PROXY_ADDRESSES is a multivalued property (PT_MV_TSTRING). ' Therefore, you need to extract the individual members. For Each v In objField.Value If InStr(1, UCase(v), g_strEMailAddressIdentifier) Then strReturnValue = Mid(v, 6, 256) Exit For End If Next 'Next Field Value Exit For End If Next 'Next Address Entry 'Return Function Value GetEMailAddress = strReturnValue 'Housekeeping Set objField = Nothing Set MyAddressList = Nothing Set MyAddressEntries = Nothing Set MyEntry = Nothing Set MyRecipient = Nothing objSession.Logoff Set objSession = Nothing End Function -- HTH... Jim Thomlinson "Steve" wrote: What are the other options if I want to call Outlook from Excel. I would need to get email addresses from Outlook and things of that nature. Also, is it ok to load CDO.dll on the users computers? It seems that is the only file missing, and when I copied CDO.dll from my computer to another one of my computers it seemed to work then.. Is it necessary to install from the CD. "Jim Thomlinson" wrote: The CDO library is part of the Outlook install. If it is not installed then you need to get it installed (you need the office disk and the necessary permissions to perform an install on the host computer). I did some developement with CDO but ended up abandoning it because of just these kind of issues. Also note that CDO operates differently on 2000 depending on what service pack is installed (extra security prompts the user for approvals and such). -- HTH... Jim Thomlinson "Steve" wrote: Good day. I am designing an Excel solution that will require CDO 1.21 library. How can I be sure each user has this installed, and if they are using Excel 2000 or less, how can I install it for them via code or an intall routine. Thanks, |
Microsoft CDO 1.21 library
Sorry I just re-read this post. CDO is handy for a pile of things beyond just
Outlook. From your previous posts you are using it in conjunction with the outlook address book which means that in the grander scheme of things the host machine could have CDO on it because CDO comes with outlook... -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: I can not imagine that there would be a problem with distributing the CDO (more of a guess than a legal opionion) file since the dll is only handy for playing with Outlook. If they have Outlook then they could have installed the CDO on their own... Before you send them a copy of CDO make sure you are not overwriting a CDO file that they already have on their system... -- HTH... Jim Thomlinson "Steve" wrote: Ok, so as far as you know, if I can just copy the CDO.dll file to their computer and it works, that is ok. It is legally ok to distribute the CDO.dll file if the user already has legal copies of Outlook and Excel on their computer.(I know this question may be out of your area and may not pertain to this forum) "Jim Thomlinson" wrote: You might be able to get away with just copying CDO.dll to the host computer. That was not an option for me because of potential administrator restrictions on the host machines in terms of installing files and how to get the files sent to them in the first place. The code that I was using accessed the global address list to get e-mail addresses. When the new service pack was installed the host machine would prompt the user that a program was trying to access the Global Address list (it thought that the program might be a virus trying to e-mail). It was at this point that I abandoned the project. -- HTH... Jim Thomlinson "Steve" wrote: What are the other options if I want to call Outlook from Excel. I would need to get email addresses from Outlook and things of that nature. Also, is it ok to load CDO.dll on the users computers? It seems that is the only file missing, and when I copied CDO.dll from my computer to another one of my computers it seemed to work then.. Is it necessary to install from the CD. "Jim Thomlinson" wrote: The CDO library is part of the Outlook install. If it is not installed then you need to get it installed (you need the office disk and the necessary permissions to perform an install on the host computer). I did some developement with CDO but ended up abandoning it because of just these kind of issues. Also note that CDO operates differently on 2000 depending on what service pack is installed (extra security prompts the user for approvals and such). -- HTH... Jim Thomlinson "Steve" wrote: Good day. I am designing an Excel solution that will require CDO 1.21 library. How can I be sure each user has this installed, and if they are using Excel 2000 or less, how can I install it for them via code or an intall routine. Thanks, |
All times are GMT +1. The time now is 06:56 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com