Hello,
I urgently need some WORKING examples for my FW application to :
1. Read an appointment out of Outlook
2. Write an appointment to Outlook
3. Read a task out of Outlook
4. Write a task to Outlook
5. Read messages from the Inbox.
Can someone provide these to me ?
Thank you very much in advance.
Michel
Urgent question about Outlook
Urgent question about Outlook
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Urgent question about Outlook
This is a working sample for Inbox:
EMG
Code: Select all
#define olFolderInbox 6
FUNCTION MAIN()
LOCAL oOutlook := CREATEOBJECT( "Outlook.Application" )
LOCAL oNameSpace := oOutlook:GetNameSpace("MAPI")
LOCAL oInbox := oNameSpace:GetDefaultFolder( olFolderInbox )
LOCAL i
FOR i = 1 TO oInbox:Items:Count
? oInbox:Items[ i ]:Body
?
NEXT
oOutlook:Quit()
RETURN NIL
Re: Urgent question about Outlook
Sample for Add-Task
Code: Select all
FUNCTION AddOLTask( cDate, cSubject, cNotiz, cTime )
LOCAL hOutlook, hAppItem, dDate
LOCAL lSave := .f.
TRY
hOutlook := CreateOLEObject( "Outlook.Application"
hAppItem := OLEInvoke( hOutlook, "CreateItem", 3 )
dDate := CToD( cDate )
OLESetProperty( hAppItem, "DueDate", dDate )
OLESetProperty( hAppItem, "Remindertime", cDate + " " + cTime )
OLESetProperty( hAppItem, "ReminderSet", "Y" )
OLESetProperty( hAppItem, "StartDate", Date() )
SET CENTURY ON
SET Date TO GERMAN
OLESetProperty( hAppItem, "Duration", 60 )
OLESetProperty( hAppItem, "Subject", cSubject )
OLESetProperty( hAppItem, "Body", cNotiz )
OLESetProperty( hAppItem, "StartTime", cTime + ":00" )
OLEInvoke( hAppItem, "Save" )
hAppItem := NIL
hOutlook := NIL
lSave := .t.
CATCH
lSave := .f.
END
RETURN (lSave)
Re: Urgent question about Outlook
Sample Add appointment
Code: Select all
FUNCTION AddOLappointment( cDate, cTime, nLenInMin, cSubject, cNotiz )
LOCAL hOutlook
LOCAL hApptItem
LOCAL dDate
LOCAL lSave := .F.
TRY
hOutlook := CreateOLEObject( "Outlook.Application" )
hAppItem := OLEInvoke( hOutlook, "CreateItem", 1 )
SET CENTURY ON
dDate := CToD( cDate )
OLESetProperty( hAppItem, "Start", cDate + " " + cTime )
OLESetProperty( hAppItem, "StartTime", cTime + ":00" )
SET CENTURY ON
SET Date TO GERMAN
OLESetProperty( hAppItem, "Duration", nLenInMin * 60 )
OLESetProperty( hAppItem, "Subject", cSubject )
OLESetProperty( hAppItem, "Body", cNotiz )
OLESetProperty( hAppItem, "Mileage", 225 )
OLEInvoke( hAppItem, "Save" )
hAppItem := NIL
hOutlook := NIL
lSave := .t.
CATCH
lSave := .f.
END
RETURN (lSave)
Thanks, guys.
I'll try out your code.
And I hope there is more to come here.
Thank you su much.
Michel
I'll try out your code.
And I hope there is more to come here.
Thank you su much.
Michel
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7