Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Outlook Macro to get Exchange Info from Mail (http://www.outlookbanter.com/outlook-vba/101805-outlook-macro-get-exchange-info.html)

_M_a_t_t_[_2_] May 6th 10 07:18 AM

Outlook Macro to get Exchange Info from Mail
 
Hi Ken,

Try setting a reference to CDO.DLL in the references for your VBA project.

I have this already:
Microsoft CDO 1.21 Library
C:\Program Files\Common Files\System\MSMAPI\1033\CDO.DLL

I'm starting to think this isn't possible......

_M_a_t_t_[_2_] May 6th 10 07:19 AM

Outlook Macro to get Exchange Info from Mail
 
Hi Ken,

Try setting a reference to CDO.DLL in the references for your VBA project.

I have this already:
Microsoft CDO 1.21 Library
C:\Program Files\Common Files\System\MSMAPI\1033\CDO.DLL

I'm starting to think this isn't possible......

_M_a_t_t_[_2_] May 6th 10 08:46 AM

Outlook Macro to get Exchange Info from Mail
 
Found the/a solution.

Adding Option Explicit to the head of the Module, and then Diming each
variable finally got results. Wish someone had mentioned this....

This now brings me to my next two questions:
1. How to go though each element and not cause an error message to be
displayed when nothing is there (for example if
CdoPR_BUSINESS_ADDRESS_POSTAL_CODE is empty, I get an error that allows me to
End or Debug. I'd like to skip this, and just leave it empty)?
2. How to desable to prompt from Outlook asking if I want to allow the macro
to access:
A program is trying to access e-mail addresses you have stored in Outlook.
Do you want to allow this?

I can only allow 1, 2, 5 & 10 Minutes. But not an always allow. I have
digitally signed the macros, and all work without prompting until CDO is
accessed, then the prompt appears.

Ken Slovak - [MVP - Outlook] May 6th 10 02:54 PM

Outlook Macro to get Exchange Info from Mail
 
For 1 you'd add an On Error Resume Next statement and check for IsEmpty() on
the property and check for an error. If you have either you can clear the
error and just move on.

For 2 that's the reason most of stopped using CDO many years ago, the
security. Client side CDO actually has tighter security than the Outlook
object model (server side CDO has none of the security but should not be
installed where Outlook is installed). There are hacks and kludges such as
ExpressClickYes, but I'd rather not use things like that. As a substitute
for CDO most of us have moved on to using Redemption.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"_M_a_t_t_" wrote in message
...
Found the/a solution.

Adding Option Explicit to the head of the Module, and then Diming each
variable finally got results. Wish someone had mentioned this....

This now brings me to my next two questions:
1. How to go though each element and not cause an error message to be
displayed when nothing is there (for example if
CdoPR_BUSINESS_ADDRESS_POSTAL_CODE is empty, I get an error that allows me
to
End or Debug. I'd like to skip this, and just leave it empty)?
2. How to desable to prompt from Outlook asking if I want to allow the
macro
to access:
A program is trying to access e-mail addresses you have stored in Outlook.
Do you want to allow this?

I can only allow 1, 2, 5 & 10 Minutes. But not an always allow. I have
digitally signed the macros, and all work without prompting until CDO is
accessed, then the prompt appears.




All times are GMT +1. The time now is 09:27 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com