>>>I did find an excellent source from sergey for the first part my equation -
>>>finding out if exe is open - in my case outlook
>>>
>>>
https://www.berezniker.com/content/pages/visual-foxpro/check-if-exe-running-and-optionally-terminate-it>>>
>>>the second stage however is what I want to reverse
>>>in sergey's example - if exe open then close it
>>>in my case I want: if exe closed open it.
>>>
>>
>>IIRC, Outlook never opens more than one instance. So you can just open it when you need it without checking first.
>>
>>Tamar
>thanks tamar. i think i have misstated my task. i wanted to open outlook programmatically.
>my purpose was to send an email out automatically that did not involve operator.
>if it's closed, and i issue the send() command - i get an error message.
>that's why i need to open it first, then send().
You can open Outlook with automation:
oOutlook = CREATEOBJECT("Outlook.Application")
oNS = oOutlook.GetNameSpace("MAPI")
If Outlook is already open, you'll get a reference to the existing instance.
Tamar