Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook Scheduling through VFP 2

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,828
JP
Hi,
I recently saw an application that would automatically place a meeting in an outlook calendar. (So for instance, there was a time and date set with a comment, and a little "Magic Button" next to it, that said, "Make Outlook Appointment".) I'm wondering how to accomplish this in VFP? I don't think the application was a VFP application, but figure if one program can do it, VFP should be able too also. Can anyone help?


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Didn't try it, but it looks like all the ingredients are present. How to Automate a Task in Outlook faq184-1771

Brian
 

Hi Scott,

Something like this should give you a good start:

Code:
oOut = CREATEOBJECT("outlook.application")
oAppItem = oOut.CreateItem(1)
oAppItem.start = {^2006-06-10 12:00:00}
oAppItem.end = {^2006-06-10 13:00:00}
oAppItem.subject = "Meeting to discuss VFP"
oAppItem.body = ;
  "Here is our agenda for the meeting .. etc."
oAppItem.Location = "Edinburgh"
oAppItem.save

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,
Will give that a try. Looks fantastic, and exactly like the kind of thing I want. Just wondering, will this work even if I don't have Outlook running at the time? (i.e. It's installed on my PC, but I don't have it "open" will it cause outlook to open, or even just "bang" the entry in, and I'll see it the next time I open it up?


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Just wondering, will this work even if I don't have Outlook running at the time?

This part oOut = CREATEOBJECT("outlook.application") will create an instance of Outlook, so it does not need to be running at the time.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 

Scott,

Yes, it will work even if Outlook is not running, although I don't completely agree with Mike Gagnon that it will launch an instance of Outlook.

Mike: What you said applies to Word and Excel, but I believe Outlook is different in this respect. The CREATEOBJECT() probably launches some internal Outlook processes, but it doesn't launch the full user interface.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Actually, I'm pretty sure it does, but as with the others, you don't see Outlook until you set Visible to .T.

Tamar
 
Well, my preference is to keep it "Invisible". Nothing I hate more than an application launching off windows or applications I don't need once the "automation" is done. Just didn't want the user to *HAVE* to have the application running either in order for it to work! Thanks everyone!


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Tamar,

I'm pretty sure it does, but as with the others, you don't see Outlook until you set Visible to .T.

I'm pretty sure it doesn't. At least, I can't see any sign of it in Task Manager. Also, Outlook doesn't have a Visible property.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Good point. That's what I get for answering off the top of my head. The real answer is that it starts Outlook, but to display the interface, you have to create and activate an Explorer object.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top