>lcontinue = .F. >oOutlook = CREATEOBJECT("Outlook.Application") >IF VARTYPE( oOutlook) = "U" > Messagebox( "Outlook must be running") > oOutlook = null > RELEASE oOutlook > QUIT >ELSE > outlookAccounts = oOutlook.GetNamespace("MAPI").Accounts > FOR i = 1 TO outlookAccounts.Count > IF outlookAccounts.Item(i).DisplayName = "SomeEmail@mybusiness.com" THEN > lcontinue = .T. > EXIT > ENDIF > ENDFOR > outlookAccounts = null > RELEASE outlookAccounts > > IF !lcontinue > Messagebox( "You can't use the application.") > oOutlook = null > RELEASE oOutlook > quit > ENDIF >ENDIF >oOutlook = null >RELEASE oOutlook >>
oMapi = oOutlook.GetNamespace("MAPI")
outlookAccounts = oMapi.Accounts
Tamar