There are several workarounds using your own resources:
1. Take a look at FAQ #8155 here: "How do I avoid the annoying Outlook dialog sending Outlook automation or MAPI email?" It may meet your needs.
2. To gain more control you can use the very same idea as in #1 above to create your own exe program that is hidden and waits for the OutLook dialog and sendkeys("Y") to it.
Something like this:
*--------------------------
* YFORCEOL.EXE
*ForceOl to Work
*Yuri Rubinov, 2002
lParameter pcFlFlagNAme
if version(2)=0
_screen.left=-5000
endif
Local plFlagFileEndMode
* File Flag removed or TimeOut
plFlagFileEndMode = (type("pcFlFlagNAme")="C")
pnTimeOut=120000 && 2 min
if plFlagFileEndMode
erase (pcFlFlagNAme)
=strtofile(" ",pcFlFlagNAme)
endif
PRIVATE oShell, LtimerOL, Starttime
starttime=SECONDS()
oShell = CreateObject("WScript.Shell")
LtimerOL=createobject("ForceOL",pnTimeOut,pcFlFlagNAme)
read events
LtimerOL=.NUll.
oShell=.Null.
Return
*----------------------------------------
Define class ForceOL as Timer
Interval = 1000
Name = "ForceOL"
timeoutdef = 60000
FlagName=""
Procedure INIT
Lparameter pnTimeOut, pcFlFlagNAme
if type("pnTimeOut")="N"
this.timeoutdef=pnTimeOut
endif
if type("pcFlFlagNAme")="C"
this.FlagName=pcFlFlagNAme
endif
endproc
Procedure Timer
if oShell.AppActivate("Microsoft Outlook")
oShell.SendKeys("Y")
ENDIF
do case
case SECONDS()-starttime>=this.timeoutdef/1000 clear events
case not empty(this.FlagName) and not file(this.FlagName)
clear events
endcase
Endproc
Enddefine
*--------------------------
You should run this program as EXE before calling email procedure in your program.
DECLARE INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle,;
STRING cOperation,;
STRING cFileName,;
STRING cParameters,;
STRING cDirectory,;
INTEGER nShowWindow
lcflag=sys(5)+curdir()+"flag.fff"
= ShellExecute(0,"open",fullpath("yforceol.exe"),lcflag,"",0)
* send email here
...
To terminate this program you can /erase (lcflag)/ or do nothing when setting appropriate pnTimeOut above.
>I have a probem when I send e-mails using Windows XP and Outlook 2000 in my VFP code.
>The follow message appears:
> ' A program is trying to access e-mail addresses that are filed in the outlook. Would like to accept this?
>
>How can I send e-mail without this message appearing?
>
>Thank you!
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only