Application.Modules 属性 (Access)
使用 Modules 属性访问 Modules 集合及其相关属性。 Modules 对象,只读。
语法
表达式。模块
expression:表示 Application 对象的变量。
备注
在 Visual Basic 中使用 Modules 集合的属性来引用所有打开的标准模块和类模块。
示例
以下示例使用 Module 属性在窗体的 Open 事件中插入 Beep 方法。
Dim strFormOpenCode As String
Dim mdl As Module
Set mdl = Forms!MyForm.Module
strFormOpenCode = "Sub Form_Open(Cancel As Integer)" _
& vbCrLf & "Beep" & vbCrLf & "End Sub"
With mdl
.InsertText strFormOpenCode
End With
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。