【问题标题】:Add clickable checkbox to powerpoint slide on Mac在 Mac 上的 powerpoint 幻灯片中添加可点击的复选框
【发布时间】:2021-07-16 03:46:45
【问题描述】:

我想在 PowerPoint 演示幻灯片中添加一个可点击复选框(一个或多个)。我正在使用 MacOS 和 Microsoft Office 365。

我猜可以使用用 VBA 创建的宏,但我不知道需要为此创建什么代码。

如果您能分享必要的代码或建议我在 Mac 下的 pptx 中创建可点击复选框的其他相关方法,我将不胜感激。

【问题讨论】:

    标签: vba checkbox powerpoint ms-office


    【解决方案1】:

    复选框、标签、文本框等都是 ActiveX 功能,由于 Mac 版本的 Office 或 MacOS 通常不支持 ActiveX,因此您不能像在 Windows 版本的 Office 中那样执行此操作。

    您可以通过添加绘制的矩形并为每个矩形分配运行宏操作设置来伪造它。

    我维护的 PPT FAQ 上的这个页面解释了如何编写宏。 确定单击了哪个形状 https://www.pptfaq.com/FAQ00141_Determine_which_shape_was_clicked.htm

    TL;DR - 这是一些示例代码。这可以在 Windows 和 Mac 上运行(PPT 的 VBA 模型中的错误迫使它比其他情况更复杂):

    Sub DoSomethingTo(oSh as Shape)
    
       Dim oSl as Slide
       Dim oShTemp as Shape
    
       ' oSh.Parent returns a valid reference to the shape's host slide:  
       Set oSl = ActivePresentation.Slides(oSh.Parent.SlideIndex)
    
       ' and oSh.Name works:
       MsgBox oSh.Name
    
       ' So we use those two bits to get a reference 
       ' to the clicked shape like so
       Set oShTemp = oSl.Shapes(oSh.Name)
       With oShTemp
           .TextFrame.TextRange.Text = oSh.Name
           ' and whatever else you want to do with the shape
       End With
    
    End Sub
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-21
      • 2017-08-11
      • 2017-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多