This documentation is archived and is not being maintained.

OnStartupComplete Method

Visual Studio .NET 2003

Occurs when the environment has completed starting.

[Visual Basic .NET]
Public Sub OnStartupComplete( _
   ByVal custom() As Variant _
[Visual Basic 6]
Sub OnStartupComplete( _
   ByVal custom() As Variant _
HRESULT __stdcall OnStartupComplete(
   SAFEARRAY** custom
void OnStartupComplete(
   object[] custom
[JScript .NET]
public function OnStartupComplete(
   custom : Object[]


An array of Variants that you can use to provide additional data. Nothing is passed by Visual Studio .NET.


OnStartupComplete is a method that, when its host interface (IDTExtensibility2) is implemented, acts as an event that occurs when the environment has completed starting.

The OnStartupComplete event occurs when the host application completes its startup routines, in the case where the Add-in loads at environment startup. If the Add-in is not loaded when the application loads, the OnStartupComplete event does not occur, even when the user loads the Add-in through the Add-In Manager dialog box. When this event does occur, it occurs after the OnConnection event.

You can use the OnStartupComplete event procedure to run code that interacts with the application, but it should not be run until the application has finished loading. For example, if you want to display a form that gives users a choice of documents to create when they start the application, you can put that code in the OnStartupComplete event procedure.


Note that this code works only in an Add-In project, not in macros.

Imports Microsoft.Office.Core
imports Extensibility
imports System.Runtime.InteropServices
Imports EnvDTE

<GuidAttribute("B25D9733-A1B2-420D-8F6B-478E2B051C83"), ProgIdAttribute("MyAddin1.Connect")> _
Public Class Connect
   Implements Extensibility.IDTExtensibility2

   Dim applicationObject As EnvDTE.DTE
   Dim addInInstance as EnvDTE.AddIn
   Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete
      Msgbox("IDE startup complete event occuring.")
   End Sub
End Class

See Also

OnAddInsUpdate Method | OnBeginShutdown Method | OnConnection Method | OnDisconnection Method

Applies To: IDTExtensibility2 Interface