Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Outlook appointments to Subfolder(s) of Calendar
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00668579
Message ID:
00669249
Views:
27
Thanks for the reply. Am now able to create a 'subfolder' of the outlook "Calendar" and add appointments to the subfolder using the following:
Public oOutLookObject
oOutLookObject = CreateObject("Outlook.Application")

oNameSpace=oOutlookObject.GetNameSpace("MAPI")
oCal=oNameSpace.GetDefaultFolder(olFolderCalendar) &&  #DEFINE olFolderCalendar 9

*!* Add a subfolder below the standard Calendar folder
loCal = oCal.folders.Add("ACME4")

loNewAppoint = loCal.Items.Add()  && create reference to new appoint 
WITH loNewAppoint
   .Start = DTOT( DATE() )		
   .End   = DTOT( DATE() + 7 )
   .AllDayEvent = .T.		&& make all day event
   .Subject = ALLTRIM("Make backup")
   .ReminderSet = .F.		&& turn off reminder
   .Save()
ENDWITH

RELEASE oCalItem
RELEASE oOutLookObject
Do u know how to determine if a folder already exists before creating it (besides using the VBA chm file example of errortrapping the FOLDERS.ADD command incase the folder already exists).

And unlike outlook contacts, i cant find where i can populate an appointment field with a PK value in order to locate it in the event i need to update an existing appointment from a database instead of adding a new one. Anyone doing this?






>>I can add outlook appointments no problem. But i need to:
>>
>>1) programmatically create multiple subfolders of the outlook CALENDAR folder (if subfolder not already defined)
>>
>>2) add appointments to the appropriate subfolders
>>
>>3) delete appointments from these subfolders
>
>MSKB#Q269617 shows how to create a subfolder of Contacts and add new contacts. Can you generalize from there, or do you need more specifics?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform