Outlook hindrer vb-sript at sende mail ( Warning)

Tags:    visual-basic


Hej

Jeg har lavet et vb-script der sender en mail med vedhæftet pdf-dokument til udbakken i Outlook.
sriptet stoppes dog undervejs idet Outlook siger

"
Et program prøver at få adgang til de e-mail-adresser, du har gemt i Outlook. Vil du tillade det? Hvis dette kommer uventet, kan det være en virus, og du skal vælge Nej.
"

Det er en kendt security-indstilling i Outlook.
MEN - er der nogen der ved hvordan man kan slå det fra.

Har søgt på nettet og fundet mange ideér, men ikke noget der virker ( både til Outlook der administreres lokalt og via Exchange-server osv).

Nogen der har en idé



Jeg tror ikke det er muligt at slå fra, da det jo er en sikkerhedsindstilling som skal stoppe virus'er fra at sende mails.



Fandt ellers denne programstump på
http://support.microsoft.com/?kbid=329765
Men kan ikke finde ud af at avende det med succes :- )
----------------------------
SYMPTOMS
If you try to gain access to the Address Book programmatically by using the Outlook object model when Outlook is not running, you may receive the following security prompt, even though Allow access to address book via Outlook object model is correctly enabled in the Outlook 10 Security Settings Folder.
A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this?
If this is unexpected, it may be a virus and you should choose "No".
Back to the top
CAUSE
This behavior occurs because there is no running session of Outlook to determine the correct security profile to load. Therefore, the default security profile is used, causing the security prompt.
When you programmatically access an item in the Address Book, a session must be running to determine the correct security profile to load. When Microsoft Outlook 2002 is not running, the security dialog prompts the user because the default security profile is used.
Back to the top
WORKAROUND
To work around this issue, use the second code example in this section.
For example, this Visual Basic Scripting (VBS) Language code causes the security prompt to appear: Set ol = CreateObject("Outlook.Application")
Set AL = ol.session.addresslists("Global Address List")
Set AE = AL.addressEntries(1)
MsgBox AE.address
The following code works around the issue by causing a persistent reference to the established Outlook session, and therefore does not raise the security prompt: Set ol = CreateObject("Outlook.Application")
Set session = ol.session
Set AL = ol.session.addresslists("Global Address List")
Set AE = AL.addressEntries(1)
MsgBox AE.address





t