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



对于我正在做的演示文稿,我想检查文本框中的文本(该文本框的名称是 textbox22 ,并且是ActiveX-control(与另一个文本框中的文本相同(此文本框的名称为 naam ,但不是ActiveX-Control(。这是我现在拥有的代码:

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(.shapes(" textbox1"(。oleformat.object.text.text

而不是

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

使用

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

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

最新更新