How does Office develop WORD plug-ins through VSTO?

0 Preface

  VSTO (Visual Studio Tools for Office) is an alternative to VBA and a set of Visual Studio toolkits for creating custom Office applications. VSTO can extend Office applications (such as Word, Excel, PPT) with Visual Basic or Visual C#. This article summarizes and records the Word plug-in development through VSTO.

1. Tool preparation

  (1) Install Visual Studio
  Search for the "Visual Studio2022" installation package in Baidu and other browsers, and then install it.

  (2) Install VSTO
  Select the "Office/SharePoint Development" toolset in the Visual Studio Installer to install.
  insert image description here

2. Word add-in program creation and generation

  (1) New project
  insert image description here

  (2) Create a functional area
  insert image description here

  insert image description here

  (3) Add function button
  insert image description here

  (4) Realize the function code
  Double-click the button1 button and write the code:
  insert image description here

using System.Windows.Forms;
  
MessageBox.Show("Hello, WordAddIns.");

3. Add-in program generation and use

  insert image description here

References:
[1] Small Q all the way forward. Basic introduction to vsto and word - create the first word add-in [1] ; 2022-01-24 [accessed 2023-07-14].
[2] Fourteen Baylor .Use C# to develop Word VSTO add-in program example ; 2023-01-04 [accessed 2023-07-14].
[3] usdoc document preview. Word typesetting plug-in, VSTO official document typesetting, Word paper typesetting ; 2023-07-14].
[4] ejinxian. VSTO realizes the multi-level list function of word ; 2021-04-16 [accessed 2023-07-14].
[5] Azhangyuaner. In-depth understanding of vsto, a powerful tool for developing word plug-ins ; 2018-12-09 [accessed 2023-07-14].
[6] Azhangyuaner. Contact vsto, a powerful tool for developing word plug-ins ; 2018-12-09 [accessed 2023-07-14].
[7] chain881228. VSTO Word2003 added Menu bar, add toolbar ; 2017-08-10 [accessed 2023-07-14].

Guess you like

Origin blog.csdn.net/qq_40640910/article/details/131724328