>lContinue = .F. > >oOutlook = CREATEOBJECT("Outlook.Application") >outlookAccounts = oOutlook.GetNamespace("MAPI").Accounts >FOR i = 1 TO outlookAccounts.Count > IF outlookAccounts.Item(i).DisplayName = "myemail@mycompany.com" THEN > lContinue = .T. > EXIT > ENDIF >ENDFOR >oOutlook = null >outlookAccounts = null > >IF !lContinue > Messagebox( "You can't use that application.") > QUIT >ENDIF >You must release the variables in reverse order.
outlookAccounts = null outlook = null release outlookAccounts && recommended release outlook && recommended