Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Msmapi32.ocx
Message
 
To
22/06/2009 21:02:46
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01407718
Message ID:
01407736
Views:
55
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform