Is there a way to have a VBA create a Microsoft Teams Chat based on email addresses in a cell?

StillUnderstanding

Board Regular
Joined
Jan 30, 2021
Messages
80
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
So I seen a great bit of code to create an outlook cal appointment and then another bit of code to then add a teams invite. Code below.

I was wondering if anyone would know how to convert this to then create a teams chat based on email addresses in a specified cell?


VBA Code:
Sub new_teams_meeting



'Create place to store meeting

Dim newmeeting As Outlook.AppointmentItem



Dim meetingparticipants As Outlook.Recipient



'Creates a new calendar appointment

Set newmeeting = Application.CreateItem(olAppointmentItem)



'Change from calendar to meeting

newmeeting.MeetingStatus = olMeeting



'Set the email subject as value in class

newmeeting.Subject = "Subject"



'Set start date/time

newmeeting.Start = #Start date and time#



'Set end date/time

newmeeting.End #End date and time#



'Add target email

Set meetingparticipants = ListOfEmails



'Set meeting as required attendance or optional

meetingparticipants.Type = olRequired



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





'Show the meeting

newmeeting.Display

'Switch on tab keyboard short cuts

SendKeys "{F10}", True



'Switch to ribbon shortcuts

SendKeys "H", True



'Hit the Microsoft teams meetings button, requires teams to be installed

SendKeys "TM", True



'Now to add signature: Switch to meeting location button

SendKeys "{Tab}", True



'Switch to email body

SendKeys "{Tab}", True



'Highlight all the text

SendKeys "^+{END}", True



'Go to end of text so that the signature is at the bottom

SendKeys "{END}", True



'turn on tab shortcuts

SendKeys "{F10}", True



'select the Insert tab

SendKeys "N", True



'Open the signature drop down

SendKeys "AS", True



'Select first signature and close signature list

SendKeys "{ENTER}"



End Sub
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top