Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open outlook
Message
From
23/02/2016 08:42:47
 
 
To
22/02/2016 13:25:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01631776
Message ID:
01631871
Views:
102
This message has been marked as the solution to the initial question of the thread.
Likes (1)
>>>>>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
>
>mmm thanks tamar - does not seem to open it. I think there must be a line missing. I tried adding visible - nothing happening.

Should have given you a little more, but I forgot because I always have Outlook open. From my Automation book:

When you open Outlook this way, you run into yet another difference. As noted previously, Outlook’s Application object doesn’t have a Visible property. In order to make Outlook visible, so you can see what you’re doing, you have to create and display an Explorer object, Outlook’s face to the world. Here’s the code:
#DEFINE olFolderDisplayNormal 0

oNameSpace = oOutlook.GetNameSpace("MAPI")

oExplorer = oOutlook.Explorers.Add(oNameSpace.Folders[1],olFolderDisplayNormal)

oExplorer.Activate()
Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform