sure.
i tried this one and it works except that the body is not html fornatted, how can i do that? in another function i use to make emails i have HTMLbody, here is no available
and moreover, it is a teams meeting without i have to specify that, how can i make a presence meeting?
Code:
Sub CreateAppt(Richiesto As Recordset, DataInizio As Date, Subj, BodyTXT, Inizio, Fine As String, Teams As Boolean, Optional Ind As String, Optional Opzionale As Recordset, Optional Risorsa As Recordset) Dim olApp As Outlook.Application
Dim olAppItem As Outlook.AppointmentItem
Dim myRequiredAttendee, myOptionalAttendee, myResourceAttendee As Outlook.Recipient
Set olApp = GetObject("", "Outlook.Application")
Set olAppItem = olApp.CreateItem(olAppointmentItem)
With olAppItem
.MeetingStatus = olMeeting
.SUBJECT = Subj
.Location = Ind
.Start = FormatDateTime(DataInizio & " " & Inizio) '#9/24/2009 1:30:00 PM#
.BodyFormat = olFormatHTML
.Body = BodyTXT
.Duration = (Left(Fine, 2) - Left(Inizio, 2)) * 60 + Right(Fine, 2) - Right(Inizio, 2)
.ReminderMinutesBeforeStart = 15
End With
Do Until Richiesto.EOF
Set myRequiredAttendee = olAppItem.Recipients.Add(Richiesto!Email)
myRequiredAttendee.Type = olRequired
Richiesto.MoveNext
Loop
If Not Opzionale Is Nothing Then
Do Until Opzionale.EOF
Set myOptionalAttendee = olAppItem.Recipients.Add(Opzionale!Email)
myRequiredAttendee.Type = olOptional
Opzionale.MoveNext
Loop
End If
If Not Risorsa Is Nothing Then
Do Until Risorsa.EOF
Set myResourceAttendee = olAppItem.Recipients.Add(Risorsa!Email)
myRequiredAttendee.Type = olResource
Risorsa.MoveNext
Loop
End If
olAppItem.Display
' If Teams Then
' SendKeys "{F10}", True
' 'Switch to ribbon shortcuts
' SendKeys "%H", True
' 'Hit the Microsoft teams meetings button, requires teams to be installed
' SendKeys "TM", True
' End If
'olAppItem.Send
End Sub