Solved

Insert in Outlook Calendar with VFP

Posted on 2013-06-01
3
1,155 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASE reports it as spam 2 123
Cannot expand the folder in Outlook 6 56
Outlook 2010: problems with certificate 26 118
exchange 19 41
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
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…

896 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now