Freigeben über


Auswählen des geeigneten Automatisierungsansatzes

Aktualisiert: November 2007

Visual Studio provides several options for creating automation applications. The exact method to choose, however, depends largely on the impending task. To help guide you to the best method, consider the following factors.

Do you want to distribute the code or a compiled application?

  • Distribute code — Use a macro. You can deploy macros by copying a macro's project files to the new location. There is no setup or registration, but users of your macro must click the Tools menu, point to Macros, and then click Load Macro Project to start using them. You can also send a macro as text for use by others. For more information, see Gewusst wie: Aufzeichnen von Makros.

  • Distribute a compiled application — Use either an add-in or a wizard, or an application that uses the automation interfaces. Add-ins, wizards, and other applications that use the automation interfaces protect your intellectual property through compilation. However, to distribute them, you must use a deployment project or some other form of setup. For more information, see Gewusst wie: Erstellen von Add-Ins or Exemplarische Vorgehensweise: Erstellen eines Assistenten.

What programming language do you want to use to develop your automation application?

Does the task require user input?

How complicated is the task you are automating?

  • Very simple — If you can accomplish your task in just a few lines of code, a macro is appropriate.

  • Complicated — While macros can include forms, references, and classes, an add-in or wizard might be more appropriate.

How do you think your user will start your application?

  • Menus or command bars — Use an add-in.

  • A keyboard shortcut or the Macro Explorer — Use a macro.

  • New Project or New Item menu item — A wizard is typical for adding a new project or file to an application.

  • Autostarting with the IDE — Use an add-in.

What is the lifetime of your application?

  • I just need it for today — A temporary recorded macro may be sufficient.

  • I'll be using it long term — A macro, wizard, or add-in is suitable.

What do you need to develop?

Siehe auch

Aufgaben

Gewusst wie: Erstellen von Add-Ins

Exemplarische Vorgehensweise: Erstellen eines Assistenten

Konzepte

Diagramm "Automationsobjektmodell"

Das Automatisierungsspektrum von Visual Studio

Weitere Ressourcen

Erweitern der Visual Studio-Umgebung

Erstellen von Add-Ins und Assistenten