What can I do when I get this message: "This project uses legacy Windows support which is being phased out and will no longer be available for new projects in the next Enterprise version"

Use the UiPath.MicrosoftOffice365.Activities package that will use Microsoft Graph API endpoints.

Check here for more details:

https://docs.uipath.com/activities/other/latest/user-guide/about-the-microsoft-office-365-activities-pack
https://docs.uipath.com/activities/other/latest/user-guide/office365-project-compatibility
https://docs.uipath.com/activities/other/latest/user-guide/office365-setup