Solved

Insert in Outlook Calendar with VFP

Posted on 2013-06-01
3
1,140 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
Comment Utility
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
Comment Utility
BUMP

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

Bye, Olaf.
0
 

Author Closing Comment

by:etm_wkl
Comment Utility
Thanks a lot.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
If you don't know how to downgrade, my instructions below should be helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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: …

744 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

10 Experts available now in Live!

Get 1:1 Help Now