Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Insert in Outlook Calendar with VFP

Posted on 2013-06-01
3
Medium Priority
?
1,242 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 30

Accepted Solution

by:
Olaf Doschke earned 2000 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 30

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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

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.
This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
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: …
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…

722 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