如何在 VBA (PowerPoint) 中检查随机幻灯片上文本框内的文本?

How to check the text inside a textbox on a random slide in VBA (PowerPoint)?

对于我正在制作的演示文稿,我想检查文本框内的文本(该文本框的名称是 TextBox2 并且是一个 ActiveX 控件)是否相同作为另一个文本框中的文本(此文本框的名称是 naam 但不是 ActiveX 控件)。这是我现在的代码:

Dim osld As Slide
Set osld = ActivePresentation.SlideShowWindow.View.Slide

Dim vragen As Byte
Dim juist As Byte
Dim fout As Byte

If osld.Shapes("TextBox2").TextFrame.TextRange = osld.Shapes("naam").TextFrame.TextRange Then
osld.Shapes("TextBox2") = ""

当我想要 运行 这段代码时,出现错误(未找到方法或数据成员)。

我怎样才能让这段代码正常工作?

activepresentation.Slides(1).形状("TextBox1").OLEFormat.Object.Text

而不是

If osld.Shapes("TextBox2").TextFrame.TextRange = etc

使用

If osld.Shapes("TextBox2").OLEFormat.Object.Text = etc

osld.Shapes("TextBox2").OLEFormat.Object.Text = ""