Antonio,
First could you please say what the actual message is?
In the meantime I can suggest a couple of things to try on Vista.
1. make sure User Account Control is turned On. Scripts don't work (sometimes don't even run) when it is turned off
2. also ensure the current user has "Full Control" setting turned on on the security properties of the script.
Also bear in mind that the script is slightly different depending on whether it office outlook (as the case is) or windows mail or indeed windows live mail.
Regards
>Mathias
>
>The code that you send me works to avoid the message "A program is trying to automatically send an email in your name? Do you allow this?"
>
>But I got another message.
>
>This new windows vista message ocurrs when the vbscript is executed. The message is related with the lack of program editor for vbscript.
>
>Could you help me?
>
>
>>Apparently that is a security feature is NOT suppose to be avoided.
>>
>>You can write a script that mimmicks a user's response to dismiss that dialogue. Here is the script that will do it:
>>'------------------------------------
>>'DismissDialogue.VBS
>>On Error Resume Next
>>Set WshShell = Wscript.CreateObject("WScript.Shell")
>>Do
>>Loop Until WshShell.AppActivate("Microsoft Office Outlook")
>>Wscript.Sleep WScript.Arguments(0)
>>WshShell.SendKeys "{TAB}"
>>WshShell.SendKeys "{TAB}"
>>WshShell.SendKeys "{ENTER}"
>>'------------------------------------------
>>
>>Save the script in a .vbs file. For testing you could have it in the root of you app.
>>
>>Now within the app just before the .Send() start the script like this:
>>
>>lcCommandString = "'DismissDialogue.vbs " + Chr(34) + Transform(10) + Chr(34)
>>oWshShell = CreateObject("WScript.Shell")
>>oWshShell.Run(lcCommandString)
>>oWshShell = Null
>>
>>Scripting is also subject to it's own security concerns.
>>
>>
>>
>>>I am using activex msmapi32.ocx do send email. When my VFP program is trying to send email using outlook the following message appears "A program is trying to automatically send an email in your name? Do you allow this?"
>>>
>>>How to avoid this message?
Mathias Banda
Time is longer than a rope.