Discussion:
VFP & Outlook
(too old to reply)
Andy Trezise
2005-04-11 11:45:53 UTC
Permalink
Hi

Can anyone tell me how to retrieve an appointment out of my outlook
calendar?

I add the appointment as follows, but I don't know how I can get the message
back and change it (i.e. add more text, change time etc).

-----------------------------

oOutlook = CREATEOBJECT("Outlook.Application")

oNS = oOutlook.GetNamespace("MAPI")

oNS.Logon()

oAppt = oOutlook.CreateItem(oAppointmentItem)

WITH oAppt

.Subject = "Appointment"

.Body = "Development Meeting"

.Location = "My Office"

.Start = &cStart
.End = cEnd

.ReminderSet = .t.

.ReminderMinutesBeforeStart = 5

.SAVE()

ENDWITH

--------------

Many Thanks....
Mike Gagnon
2005-04-11 11:55:34 UTC
Permalink
CREATE CURSOR myCursor (start T,end T,body c(250))
LOCAL oOutlook,oNameSpace,oDefaultFolder
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.getnamespace('MAPI')
oDefaultFolder=oNameSpace.GetDefaultFolder(olFolderCalendar)
oItems = oDefaultFolder.items
FOR EACH oItem IN oItems
INSERT INTO myCursor (start,end,body) VALUES
(oItem.start,oItem.end,oItem.body)
ENDFOR
SELECT myCursor
BROWSE
Post by Andy Trezise
Hi
Can anyone tell me how to retrieve an appointment out of my outlook
calendar?
I add the appointment as follows, but I don't know how I can get the
message back and change it (i.e. add more text, change time etc).
-----------------------------
oOutlook = CREATEOBJECT("Outlook.Application")
oNS = oOutlook.GetNamespace("MAPI")
oNS.Logon()
oAppt = oOutlook.CreateItem(oAppointmentItem)
WITH oAppt
.Subject = "Appointment"
.Body = "Development Meeting"
.Location = "My Office"
.Start = &cStart
.End = cEnd
.ReminderSet = .t.
.ReminderMinutesBeforeStart = 5
.SAVE()
ENDWITH
--------------
Many Thanks....
Andy Trezise
2005-04-11 15:22:22 UTC
Permalink
Thanks for that.....

That allows me to retrieve the item....what about changing something and
then storing it back?

There is a field called entryID which I thought I could use (I already store
this in my database when I add the appointment to Outlook) but I don't seem
to be able to use FIND with that particular property.

I looked into creating a customer User Field. I managed to add this to my
Outlook form but I couldn't work out how to write to this field using VFP
code nor search for it.
Post by Mike Gagnon
CREATE CURSOR myCursor (start T,end T,body c(250))
LOCAL oOutlook,oNameSpace,oDefaultFolder
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.getnamespace('MAPI')
oDefaultFolder=oNameSpace.GetDefaultFolder(olFolderCalendar)
oItems = oDefaultFolder.items
FOR EACH oItem IN oItems
INSERT INTO myCursor (start,end,body) VALUES
(oItem.start,oItem.end,oItem.body)
ENDFOR
SELECT myCursor
BROWSE
Post by Andy Trezise
Hi
Can anyone tell me how to retrieve an appointment out of my outlook
calendar?
I add the appointment as follows, but I don't know how I can get the
message back and change it (i.e. add more text, change time etc).
-----------------------------
oOutlook = CREATEOBJECT("Outlook.Application")
oNS = oOutlook.GetNamespace("MAPI")
oNS.Logon()
oAppt = oOutlook.CreateItem(oAppointmentItem)
WITH oAppt
.Subject = "Appointment"
.Body = "Development Meeting"
.Location = "My Office"
.Start = &cStart
.End = cEnd
.ReminderSet = .t.
.ReminderMinutesBeforeStart = 5
.SAVE()
ENDWITH
--------------
Many Thanks....
Mike Gagnon
2005-04-11 16:34:07 UTC
Permalink
Let's assume you have a meeting scheduled for later today, and you want to
change to time to now, this would do it.

The only way to find it is to loop through the records based on a criteria.

LOCAL oOutlook,oNameSpace,oDefaultFolder,oItems
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.GetNameSpace('mapi')
oDefaultFolder = oNameSpace.GetDefaultfolder(9)
oItems=oDefaultFolder.items
FOR EACH loItem IN oItems
IF loItem.Subject ="Scheduled Meeting" AND SUBSTR(loItem.Start,1,8) =
DTOC(DATE())
loItem.Start =TTOC(DATETIME())
loItem.save()
endif
ENDFOR
Post by Andy Trezise
Thanks for that.....
That allows me to retrieve the item....what about changing something and
then storing it back?
There is a field called entryID which I thought I could use (I already
store this in my database when I add the appointment to Outlook) but I
don't seem to be able to use FIND with that particular property.
I looked into creating a customer User Field. I managed to add this to my
Outlook form but I couldn't work out how to write to this field using VFP
code nor search for it.
Post by Mike Gagnon
CREATE CURSOR myCursor (start T,end T,body c(250))
LOCAL oOutlook,oNameSpace,oDefaultFolder
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.getnamespace('MAPI')
oDefaultFolder=oNameSpace.GetDefaultFolder(olFolderCalendar)
oItems = oDefaultFolder.items
FOR EACH oItem IN oItems
INSERT INTO myCursor (start,end,body) VALUES
(oItem.start,oItem.end,oItem.body)
ENDFOR
SELECT myCursor
BROWSE
Post by Andy Trezise
Hi
Can anyone tell me how to retrieve an appointment out of my outlook
calendar?
I add the appointment as follows, but I don't know how I can get the
message back and change it (i.e. add more text, change time etc).
-----------------------------
oOutlook = CREATEOBJECT("Outlook.Application")
oNS = oOutlook.GetNamespace("MAPI")
oNS.Logon()
oAppt = oOutlook.CreateItem(oAppointmentItem)
WITH oAppt
.Subject = "Appointment"
.Body = "Development Meeting"
.Location = "My Office"
.Start = &cStart
.End = cEnd
.ReminderSet = .t.
.ReminderMinutesBeforeStart = 5
.SAVE()
ENDWITH
--------------
Many Thanks....
Loading...