Alaska Software Inc. - re : Outlook Confirmation Bypass
Username: Password:
AuthorTopic: re : Outlook Confirmation Bypass
Chris Palmerre : Outlook Confirmation Bypass
on Thu, 26 Mar 2009 11:16:18 +0000
AUGE_OHRRe: Outlook Confirmation Bypass
on Thu, 26 Mar 2009 13:27:41 +0100
hi,

>Any suggestions on how to check what the user has decided ?

IF IsMemberVar(oMail,"Recipients")
    IF IsMethod(oMail:Recipients,"add")
        oMail:Recipients:Add( cMail )

greetings by OHR
Jimmy
Chris PalmerRe: Outlook Confirmation Bypass
on Thu, 26 Mar 2009 15:43:51 +0000
Andreas Gehrs-Pahl
Re: Outlook Confirmation Bypass
on Thu, 26 Mar 2009 12:13:47 -0400
Chris,

>Please help !!!!

You should trap this exception in a Sequence.

LOCAL bError, oMail, lContinue := .t.
LOCAL oOL := CreateObject("Outlook.Application")
   if oOl == NIL
      MsgBox("Failed To Open Microsoft Outlook", "Test System")
      return (lContinue)
   endif
   oMail  := oOL:CreateItem(0)
   bError := ErrorBlock({|e| Break(e)})
   BEGIN SEQUENCE
      oMail:Recipients:Add(cMail)
   RECOVER USING oError
      ErrorBlock(bError) ; lContinue := .f.
      if oError:OSCode # (-2147467260)
*        Some other error occurred -- log or show Message?
      endif
   END SEQUENCE
   ErrorBlock(bError)
   if lContinue
*     Send EMail...
   endif
   oOL:Destroy()
return (lContinue)

Or something similar.

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
Thomas Braun
Re: Outlook Confirmation Bypass
on Thu, 26 Mar 2009 17:22:11 +0100
Chris Palmer wrote:

> Thanks but this doesn't seem to be working !!!
> 
> The Error is occuring on the line - 
>     oMail:Recipients:Add( cMail )
> But this is the line that prompts Outlook to display the following message :-
> 
> If No is pressed, the error is created !!!
> In other words, the line causing the error is the same one executing the command to check for the error !!!!

You might be able to use local error handling to catch/ignore the error.

regards
thomas