从另一个窗体调用控件获取错误:找不到方法或数据成员

时间:2018-10-09 02:58:58

标签: vba

我遇到错误编译项目时找不到方法或数据成员。按钮控件“ btnViewUpdateRefresh”以其他形式存在。

Private Sub UserForm_Terminate()
Dim oSection As Word.Section
Dim oRange As Word.Range
Dim var

If Documents("PART V1.0.docm").ProtectionType <> wdNoProtection Then
    Documents("PART V1.0.docm").Unprotect "1234"
Else
End If

ThisDocument.Activate
ThisDocument.StoryRanges(wdMainTextStory).Delete

MainWindow.Show

Call MainWindow.btnViewUpdateRefresh_Click --> error points in here.

If Documents("PART V1.0.docm").ProtectionType <> wdNoProtection Then
Else
    Documents("PART V1.0.docm").Protect wdAllowOnlyFormFields, True, "1234"
End If

结束子

0 个答案:

没有答案