Title: Wincom and Outlook Post by: Stefan S. on May 27, 2011, 10:54:21 am Hello,
I try to read the local (or public) Outlook Calender with wincom. But I have no success. I have a function to save appointments to outlook, but now I want to read them. I have found a outlook-Makro which display the appointments, but I have no Idea how to do this with WinCom in Genero. Has anyone an idea Kind regards Stefan Serwe Quote Sub AlleTermineAuflisten() Dim olApp As Outlook.Application Dim olNameSpace As Outlook.NameSpace Dim olCalendar As Outlook.MAPIFolder Dim olAppointment As Outlook.AppointmentItem Dim s As String Dim d As Date Dim t As Date Dim ts As String Dim n As Integer Set olApp = CreateObject("Outlook.Application") 'oder New Outlook.Application Set olNameSpace = olApp.GetNamespace("MAPI") Set olCalendar = olNameSpace.GetDefaultFolder(olFolderCalendar) n = 0 For Each olAppointment In olCalendar.Items n = n + 1 s = olAppointment.Subject If s = "" Then s = "-" d = Fix(olAppointment.Start) t = CDate(olAppointment.Start - d) If t = 0 Then ts = "" Else ts = " (" & CStr(t) & ")" End If 't=0 Debug.Print Fix(d) & ": " & s & ts Next 'olAppointment Set olAppointment = Nothing Set olCalendar = Nothing Set olNameSpace = Nothing Set olApp = Nothing MsgBox "Insgesamt " & n & " Einträge.", vbInformation, "Fertig" End Sub 'AlleTermineAuflisten Title: Re: Wincom and Outlook Post by: Lionel F. on May 27, 2011, 11:10:57 am Hello Stefan,
There is a sample in the GDC documentation of a WinCom/Outlook combination: https://4js.com/online_documentation/fjs-gdc-manual-html/User/WinCOM.html#EXAMPLES Now, the syntax is likely to change according to the version of Outlook you're using (The sample was tested with Outlook 2002-SP3). If it's not helpful, feel free to contact your support center on the subject. Normally what is doable using a macro should also be doable through the 4GL code: it usually only requires to adapt the VBA code using the "CallMethod" and "SetProperty" methods. So they should be able to give the right tips for achieving what you need. Regards, Lionel |