Table of contents
TOC
折叠目录
展开目录

检查或添加对象库引用Check or Add an Object Library Reference

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

如果您在其他应用程序中使用对象为 Visual Basic 应用程序的一部分,您可能需要建立对这些应用程序对象库的引用。您可以实现之前,首先必须确保该应用程序提供的对象库。If you use the objects in other applications as part of your Visual Basic application, you may want to establish a reference to the object libraries of those applications. Before you can do that, you must first be sure that the application provides an object library.

应用程序提供了对象库To see if an application provides an object library

  1. 工具菜单中,选择要显示引用对话框中的引用From the Tools menu, choose References to display the References dialog box.

  2. 引用对话框中显示所有对象库与操作系统注册。您想要引用的对象库的应用程序列表中滚动。如果应用程序没有列出,您可以使用浏览按钮搜索对象库 (.olb 和.tlb) 或可执行文件(.exe 和在 Windows *.dll)。使用的引用其复选框被选中的项目;那些不会检查未使用的但可以添加。The **References* dialog box shows all object libraries registered with the operating system. Scroll through the list for the application whose object library you want to reference. If the application isn't listed, you can use the Browse button to search for object libraries (.olb and *.tlb) orexecutable files (.exe and *.dll on Windows). References whose check boxes are checked are used by yourproject; those that aren't checked are not used, but can be added.

若要添加到项目的对象库引用To add a object library reference to your project

  • 引用对话框中可用的引用框中选择的对象库的引用,请单击确定。现在,Visual Basic 项目具有对应用程序的对象库的引用。如果您打开对象浏览器(按 F2),并选择应用程序的库,则会显示由所选的对象库,以及每个对象的方法属性的对象。在对象浏览器中器可以在框中选择一个并在成员框中选择方法或属性。使用复制和粘贴来添加到代码中的语法。Select the object library reference in the Available References box in the References dialog box and click OK. Your Visual Basic project now has a reference to the application's object library. If you open theObject Browser (press F2) and select the application's library, it displays the objects provided by the selected object library, as well as each object'smethods andproperties. In the Object Browser, you can select aclass in the Classes box and select a method or property in the Members box. Use copy and paste to add the syntax to your code.
© 2018 Microsoft