Office addin - Hide main window

KC 1 Reputation point
2021-05-06T12:54:53.663+00:00

I'm developing VSTO addin using c# for Microsoft Project. What I want is when microsoft project opens up, it should popup the login dialog very first (which I can show without a problem) and till the time login is done, microsoft project window should not load or windowremain hidden. I'm not able to hide or prevent loading the microsoft project window while launching the plugin. I tried few things i.e.

    var app = (MSProject.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("MSProject.Application");
    app.Visible = false;  // doesn't work
    app.WindowHide();  // doesn't work
    app.AppMinimize();  // works

Any inputs on how I can hide the main window of the project till the time login is done?

Thanks,

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,286 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,513 questions
0 comments No comments
{count} votes