login vsi company logo login vsi company logo 250x40
  • Home
  • Blog
  • Dismiss M365 App Popups with the Login Enterprise Virtual User

Dismiss M365 App Popups with the Login Enterprise Virtual User

Using Microsoft Office Applications is one of the best ways to get a virtual user to interact with a production representative workspace.

We all pretty much use Office applications daily. It is not uncommon for me to use Outlook, Word, Excel, and PowerPoint in the same day, and often I’m bouncing back and forth between them.

So, if you didn’t read my blog called “Finally! Free Test Licensing for Microsoft 365 Apps”, I’d encourage you to check it out because it does have some registry edits that you can use to help suppress Office popups. But there are so many popups that can stop a virtual user from playing with the application. We need to make sure we address them all to get a seamless workflow running during each session.

The Activation and Privacy Popups

Here’s the reality, these are all the popups you’ll see on a new installation of Office, using PowerPoint as an example.

Login VSI Blog - Dismiss M365 App Popups with the Login Enterprise Virtual User - Image 1 - These are all the popups you’ll see on a new installation of Office, using PowerPoint as an example

Installing Office? Expect Popups

Activation—signing in to set up Office—which is a component of licensing, is always something that will pop up if you are using a user that doesn’t have a license tied to an authorized email address. The Privacy Option popup is one that, when acknowledged, will no longer continue to popup after the registry bit has been set. These are the two I needed help from the virtual user since I couldn’t find a way to disable these through the registry.

Below we’ll look at the simple code you can add to let the virtual user do its thing (and if you would like to stop Teams from running, I might give you another useful tip below too).

First, here are our popups:

Login VSI Blog - Dismiss M365 App Popups with the Login Enterprise Virtual User - Image 2 - Popups

Office Set Up - Sign In

Login VSI Blog - Dismiss M365 App Popups with the Login Enterprise Virtual User - Image 3 - Popups

Office Set Up - Privacy Option

To stop them both from happening, let’s do the following:

    1. Download the application templates you want to use. I will use Word as an example.
    2. Open the .cs file in either Visual Studio, the Login Enterprise Script Editor, or Notepad++
    3. The activation popup happens after the application starts, so let’s find that part of the script, add our new code after that, and before the “Open File” block of code (line 29).

Login VSI Blog - Dismiss M365 App Popups with the Login Enterprise Virtual User - Image 4 - Activation popup in Script

Find the activation popup in the script

    1. After we START() the application, I like to add a Wait of 10 seconds (i.e., Wait(10) ), so we can wait for the activation popup to happen.
    2. Then I add these 2 lines (one is a comment, one is code)

  // Look for sign in window and send esc key try {var signinWindow = MainWindow.FindControl(title:"Sign in to set up Office", timeout:1); signinWindow.Type("{ESC}");} catch {}

    1. If you need to get rid of the privacy option popup, then you can add this code below that will look for the window and hit the “Close” button

  // Find privacy button and accept try{ Wait(5); var yourPrivacyOptionWindow = FindWindow(title : "Your privacy option", processName : "WINWORD",timeout:15); var closeButton = yourPrivacyOptionWindow.FindControl(className : "Button:NetUIButton", title : "Close",timeout:10); Wait(1); yourPrivacyOptionWindow.Focus(); Wait(1); closeButton.Click(); } catch{}

    1. So in the end, your code now looks like this:

Login VSI Blog - Dismiss M365 App Popups with the Login Enterprise Virtual User - Image 5 - Popups

Your code should now look like this

How Do You Do This For Any Of The Other Office Apps?

Just repeat steps 1 – 5 above for any of the other applications. Usually, I’ll put the Privacy Option Popup dismissal in the first app I run in my application workflow. Technically you should be able to put the Privacy Option code in all the Office application workflows.

Hey, You Said You’d Tell Us How To Disable Teams

If my customer is not using Teams and we’d like to see if turning it off buys us some performance, then you can add the following to any of the application workflow scripts.

  //Quit Teams ShellExecute(@"cmd /c taskkill /f /im teams*",waitForProcessEnd:true);

Note that we run this before we start the apps. (Hint, check out the line numbers)

Login VSI Blog - Dismiss M365 App Popups with the Login Enterprise Virtual User - Image 6 - Popups

Run this before you start the apps

In my limited testing, I haven’t seen a difference between quitting Teams and leaving it running.

And We’re Ready To Test With Microsoft 365 Apps

You have a free licensing from Microsoft, and you have some cool scripting you can use to take advantage of all of the M365 Apps within your virtual user application workflow. If you’re like me and the customers I’ve been working. You can use these tools to figure out how your scalability might look with Azure machine instances running Windows 10 Enterprise Multisession.

Thanks for reading my blog and don't forget to check out my other post about Office popups. Stay happy and healthy.

About the author

Blair Parkhill (@SANspyder) joined Login VSI in the summer of 2015 as the director of products. Blair has been a marketing leader, avid architect and supporter of customer-focused technology solutions and technical marketing since the late 1990s. Residing in tiny homes located in the mountains of Colorado and jungles of Costa Rica, he tries to spend as much time as he can traveling, playing music, exploring the jungle, walking on beaches, and hiking in the mountains – when he’s not playing with the product, geeking out with the latest tech, presenting, testing or blogging.