'Include Microsoft team meetings while setting meeting in outlook

Does anyone know how to include Team Meetings while setting meeting in Outlook using the VBA code below?

Teams meeting in outlook

Below is my code:

Sub setmeeting()

    Dim O As Outlook.Application
    Dim OAPT As Outlook.AppointmentItem

    Set O = New Outlook.Application

    Set OAPT = O.CreateItem(olAppointmentItem)
    OAPT.MeetingStatus = olMeeting

    With OAPT

        .RequiredAttendees = "[email protected]"
        .OptionalAttendees = "[email protected]"
        .Subject = "I Love VBA"
        .Start = "11/21/2019 12:00:00 PM"
        .End = "11/21/2019 12:30:00 PM"
        .Body = "Hello World"
        .Location = "Cubicle"
        .Display
        .Send

    End With

    Set OAPT = Nothing
    Set O = Nothing

End Sub


Solution 1:[1]

Sub teammetting()


Dim nm As Outlook.AppointmentItem


Set nm = Application.CreateItem(olAppointmentItem)

nm.MeetingStatus = olMeeting



nm.Subject = "Subject"



nm.Start = 'format:DD/MM/YYYY HH:MM:SS AM/PM



nm.End =""'format:DD/MM/YYYY HH:MM:SS AM/PM


nm.requiredattendees "mail address of the invitees"


nm.Body = "Set the body of the email"



nm.Display

SendKeys "{F10}", True


SendKeys "H", True


SendKeys "TM", True



end sub

if you are doing a loop add wait time before the start of next loop

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ryan M