Created
October 23, 2023 07:15
-
-
Save tdalon/9b3d6277707746756a153d8c6d49543e to your computer and use it in GitHub Desktop.
Teams New Switch Tenant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Teams_SwitchTenant(sTenant) { | |
WinId := Teams_GetMainWindow() | |
If !WinId ; empty | |
return | |
UIA := UIA_Interface() | |
TeamsEl := UIA.ElementFromHandle(WinId) | |
If !TeamsEl.FindFirstBy("AutomationId=idna-me-control-set-status-message-trigger") { ; menu not opened | |
; Click on avatar | |
MeCtrl := TeamsEl.FindFirstBy("AutomationId=idna-me-control-avatar-trigger") | |
MeCtrl.Click() | |
El:= TeamsEl.WaitElementExistByNameAndType("Switch to " . sTenant,"MenuItem",,1,False,1000) | |
} Else { ; menu already opened | |
El:= TeamsEl.FindFirstByNameAndType("Switch to " . sTenant,"MenuItem",,1,False) | |
} | |
If (El="") { | |
TrayTipAutoHide("Switch Tenant","Tenant name starting with '" . sTenant . "' not found!") | |
} Else | |
El.Click() | |
} ; eofun |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See details https://tdalon.blogspot.com/2023/10/teams-switch-tenant.html