Office VBA 参考Office VBA Reference

Office Visual Basic for Applications (VBA) 是一种事件驱动编程语言, 使您能够扩展 Office 应用程序。Office Visual Basic for Applications (VBA) is an event-driven programming language that enables you to extend Office applications.

Office 中的 VBA 编程VBA programming in Office

此参考适用于希望了解 VBA 以及希望深入了解编程如何帮助他们自定义 Office 的有经验的 Office 用户。This reference is for experienced Office users who want to learn about VBA and who want some insight into how programming can help them to customize Office.

Office 应用程序套件具有一组完整的功能。The Office suite of applications has a full set of features. 可通过多种不同的方法对文档、电子邮件、数据库、表单、电子表格和演示文稿进行创作、格式设置和操纵。There are many different ways to author, format, and manipulate documents, email, databases, forms, spreadsheets, and presentations.

Office 编程的强大功能是, 几乎所有可以使用鼠标、键盘或对话框执行的操作也可以通过使用 VBA 自动进行。The great power of VBA programming in Office is that nearly every operation that you can perform with a mouse, keyboard, or a dialog box can also be automated by using VBA. 此外,若某个操作可以使用 VBA 执行一次,则可以同样轻松地执行该操作一百次。Further, if it can be done once with VBA, it can be done just as easily a hundred times. 事实上, 重复任务的自动化是 Office 中 VBA 最常见的用途之一。In fact, the automation of repetitive tasks is one of the most common uses of VBA in Office.

除了可通过编写 VBA 脚本来加速执行日常任务外,还可以使用 VBA 为 Office 应用程序添加新功能,或以特定于业务需要的方式来提示文档用户并与之交互。Beyond the power of scripting VBA to accelerate every-day tasks, you can use VBA to add new functionality to Office applications or to prompt and interact with the user of your documents in ways that are specific to your business needs. 例如,可以编写一些 VBA 代码,使其在用户首次尝试保存文档时显示一个弹出消息,提醒用户将文档保存到特定网络驱动器上。For example, you could write some VBA code that displays a pop up message that reminds users to save a document to a particular network drive the first time they try to save it.

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.