如何在PowerPoint上动态创建ActiveX TextBox

我是一名自由职业的Java程序员,第一次被要求在PowerPoint上进行一些VBA编程,我有点挣扎。

我已经创建了一个按钮,该按钮会触发幻灯片的创建(此方法有效)。 在这张新幻灯片上,我想创建一个activeX文本框(在“演示”模式下可以使用的文本框之一),但是我只能创建“标准” PowerPoint文本框。

我确信这是一个非常简单的命令,但是我在任何地方都找不到。.

这是我正在使用的代码。有人可以帮我吗? 谢谢!

Public Sub addContentToSatelliteSlide()
currentSlide = activePresentation.SlideShowWindow.View.Slide.SlideIndex 
'CURRENT SLIDE ON SLIDESHOW

With activePresentation.Slides(currentSlide + 1).Shapes
    With .AddTextbox(msoTextOrientationHorizontal,160,80,400,400).TextFrame
        .textrange.Text = "add informatiom here"
        .textrange.Paragraphs.ParagraphFormat.Alignment = ppAlignLeft
        .textrange.Font.Color = RGB(255,255,255)
        .textrange.Font.Size = 11
        .textrange.Font.Name = "Arial"
        .textrange.Font.Bold = False
        .textrange.Font.Color = RGB(0,0)    'BLACK
    End With 
End With

End Sub
songyish 回答:如何在PowerPoint上动态创建ActiveX TextBox

ActiveX文本框是OLE控件,因此请改用以下语法:

            engagement
category              
Base            152.00
Female            0.34
Male              0.64
Non-binary         NaN
Prefer-not        0.01

这是Microsoft的帮助页面:Shapes.AddOLEObject method (PowerPoint)

本文链接:https://www.f2er.com/3080361.html

大家都在问