Solved

Insert in Outlook Calendar with VFP

Posted on 2013-06-01
3
1,223 Views
Last Modified: 2013-06-28
I have an application written in VFP that need to insert data in Outlook Calendar for other users (not in the user's own calendar).

And another application that needs to choose one among the many created calendars on the user account (example: personal, professional, school ...). Is it possible?

Translate from portuguese:

"Eu tenho um aplicativo escrito em VFP que precisa inserir dados no Calendario do Outlook de outros usuários ( não no calendário do próprio usuário ).

E um outro aplicativo que precisa escolher um entre os diversos calendários criados na conta do usuário ( exemplo: pessoal, profissional, escolar ... ). É possível ? "
0
Comment
Question by:etm_wkl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 500 total points
ID: 39268513
As a starter you can do:
o = CREATEOBJECT("outlook.application")
oMapi = o.GetNamespace("Mapi")
? oMapi.Logon("Profile name","password")

Open in new window

But you need to add the outlook pst accounts to your outlook. If you want to address a user you don't have access to it's pst file, then you can only send an appointment request.

That means you create a appointment item, add recipients and send the appointment, like this:
#DEFINE olAppointmentItem  1
#DEFINE olMeeting  1
#DEFINE olRequired  1
#DEFINE olOptional  2

* further outlook constants see http://fox.wikis.com/wc.dll?Wiki~OutlookConstants
* or use object browsers, open the Microsoft Outlook X.00 Object Libary (X depends on whatever your version is) and drag the Constants node into a prg for a full list

oOutlook = CreateObject("Outlook.Application")
oAppointment = oOutlook.CreateItem(olAppointmentItem)

oAppointment.MeetingStatus = olMeeting
oAppointment.Subject = "Strategy Meeting"
oAppointment.Location = "Conference Room B"
oAppointment.Start = Datetime(2013,07,01,10,00,00)
oAppointment.Duration = 90
oAppointment.Body = "My Agenda..."
oRequiredAttendee = oAppointment.Recipients.Add("someone@example.com")
oRequiredAttendee.Type = olRequired
oOptionalAttendee = oAppointment.Recipients.Add("anotherone@somwhere.com")
oOptionalAttendee.Type = olOptional
oAppointment.Send()

Open in new window


If you need more control any your company hosts an exchange server, that's the place to manage calenders of employees, not your outlook client. You'd do that server side. Outlook automation is not what helps you with that.

Bye, Olaf.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 39283603
BUMP

I've extended my answer. Just want to ensure you get noticed.

Bye, Olaf.
0
 

Author Closing Comment

by:etm_wkl
ID: 39284013
Thanks a lot.
0

Featured Post

Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question