LOCAL loOutlook loOutlook = NULL IF NOT ISNULL(GetOutlookInstance(@loOutlook)) * Proceed using Outlook instance. ELSE * Outlook object could not be instantiated. ENDIF FUNCTION GetOutlookInstance * Attach to an instance of Outlook. * RETURNS: TRUE if attachment successful, FALSE otherwise. LPARAMETERS poInstance LOCAL loInstance loInstance = NULL TRY * Try to attach to existing instance of Outlook loInstance = GETOBJECT(, "Outlook.Application") CATCH * Attaching to Outlook failed, so create new instance. loInstance = CREATEOBJECT("Outlook.Application") ENDTRY IF VARTYPE(loInstance) = "O" * We have a valid instance. poInstance = loInstance ENDIF ENDFUNC>Hey all,