How to adapt a VSTA-Form to appear as a VSTA-Wizard in the Wizard dialog (VB.Net)
Introduction Although most .Net solution are developed using c#, in some cases porting existing old code (from vba) to VB.Net might be more efficient than starting from scratch in c#. This blog entry explains which methods and functions are to be implemented in order to have a VB.Net Wizard displayed in the zenon Wizard dialog which pops up when creating a new project. Similar, yet different in small details
compared to the c# scenario. Integrating VSTA-Code into the wizard dialog In order for VSTA-C ode to be available in the wizard dialog the automation code needs to be contained (implemented) into a Windows-Form. Additionally the Form-Class needs to
implement the following set of static functions (all without parameters): Public Shared Function GetWizardName() As String Return the name of the wizard, displayed as “Name of the wizard” in the wizard dialog. Public Shared Function GetWizardInfo()
As String Return a description of the wizard, shown as “A more detailed description of the wizard.” in the wizard dialog. Public Shared Function GetWizardCategory() As String Returns the category of the wizard and is displayed as “Wizard category” in the wizard dialog. Note: An existing category can be used here. And a VSTA and a VBA wizard can reside in the same category. Public Shared Function IsZenOnWizard() As Boolean This function determines whether the wizard should appear in the dialog. It offers the possibility to stop a wizard from appearing without having to delete all functions or removing it from the Addin. Public Shared Function GetWizardVersion() As Integer This function returns the version number of the wizard, indicated next to the wizard information. Public Sub StartWizard() This method is called when the wizard has been selected in the wizard dialog and confirmed with “OK”. NOTE: It’s not allowed to have any functions with the same name inside of the wizard class, not even if their return type of parameter count is different from the “Wizard-Functions”.