Page 1 of 1

Outllook appointment Object

Posted: Thu Feb 15, 2024 10:39 am
by loulou2522
Hi all,
I find the way to create an appointment with multiple recipients, but i don't know how to join a pdf file for each recipient. Is there a way to do that ?
I have another question is-it possible to make the same thing with thunderbird?
Thanks in advance

Re: Outlook appointment Object

Posted: Thu Feb 15, 2024 2:32 pm
by Marco2007
I just know, how to add files to the appointment ...

Code: Select all

XIncludeFile #PB_Compiler_Home+"include\COMatePLUS.pbi"
Global olApp.COMateObject, olAppt.COMateObject, olFldr.COMateObject, NameSpace.COMateObject, Auslastung.COMateObject, folder.COMateObject, olRecip.COMateObject, folder1.COMateObject, Appointment.COMateObject, iAdd.COMateObject

folder$="Test"
subject$="Subject"
location$="location"
appointment_start$="24.02.2024 06:00:00"
appointment_end$="24.02.2024 12:30:00"
categories$ = "green category"
file1$=OpenFileRequester("", "", "", 0)
file2$=OpenFileRequester("", "", "", 0)

olApp = COMate_CreateObject("Outlook.Application") 
If olApp
  NameSpace = olApp\GetObjectProperty("GetNamespace(" + Chr(39) + "MAPI" + Chr(39) + ")") 
  Folder = NameSpace\GetObjectProperty("GetDefaultFolder(9)") 
  Folder1 = Folder\GetObjectProperty("Folders('"+folder$+"')")  

    iAdd = Folder1\GetObjectProperty("Items\Add") 
    iAdd\SetProperty("Subject='"+subject$+ " (" + ReplaceString(StrD(zeit, 2), ".", ",") + " h)"+ "'")
    iAdd\SetProperty("Location='"+location$ +"'")
    iAdd\SetProperty("Start='"+appointment_start$+"'")
    iAdd\SetProperty("End='"+appointment_end$+"'")   
    iAdd\SetProperty("BodyFormat = 2") 
    iAdd\SetProperty("Categories='"+categories+"'")

If file1$
  iAdd\invoke("Attachments\Add ='"+file1$+"'") 
EndIf 
If file2$
  iAdd\invoke("Attachments\Add ='"+file2$+"'") 
EndIf
  
iAdd\Invoke("Save")

If Appointment : Appointment\Release() : EndIf 
If iAdd: iAdd\Release() : EndIf 
If Folder : Folder\Release() : EndIf 
If Folder1 : Folder1\Release() : EndIf 
If NameSpace : NameSpace\Release() : EndIf   
If olApp : olApp\Release() : EndIf 
EndIf