Paso 1 Crea un VBScript llamdo WaitForOutlook.VBS
'VBScript WaitForOutlook.VBS
Set WshShell = Wscript.CreateObject("WScript.Shell")
' this waits 20 seconds from launch to action. You can experiment with
' shorter or longer durations as necessary
Wscript.Sleep 20000
WshShell.AppActivate "Microsoft Outlook"
' wait 1/10th second after requesting activation of the Outlook Window
Wscript.Sleep 100
WshShell.SendKeys "Y"
Paso 2 Crea tu codigo para el email MAPI en VFP y agregale esto
SET CLASSLIB TO wwIPStuff ADDITIVE
oIP = CREATEOBJ('wwIPStuff')
WITH oIP
.cSenderName = 'Ed Rauh'
.cSenderEmail = '
[email protected]'
.cRecipient = '
[email protected]'
.cCCList = '
[email protected],
[email protected]'
.cSubject = 'My VBScript message'
.cMessage = 'Nyah, nyah, nyah I didn't have to click "Yes"!'
.cAttachment = 'waitforoutlook.vbs'
*
* aqui esta la magia!
*
RUN /N7 cscript waitforoutlook.vbs && aqui ejecutas el script
.SendMAPIMail()
ENDWITH
oIP = NULL
Suerte