美文网首页
使用VBA改变Word中的复选框样式

使用VBA改变Word中的复选框样式

作者: 麦睿蔻 | 来源:发表于2020-01-10 15:38 被阅读0次
工作中有时需要在Word文档中使用复选框,默认的复选框选中样式为 1.png ,惯用样式应该是 2.png

我们可以使用如下VBA代码批量Word中所有的复选框选中样式:

Sub 修改控件()
    Dim oContentControl As ContentControl
    For Each oContentControl In ActiveDocument.ContentControls
        With oContentControl
            If .Type = wdContentControlCheckBox Then
               
                .SetCheckedSymbol 9745
                .SetUncheckedSymbol 9744
            End If
        End With
    Next
End Sub

效果如图:


GIF.gif

相关文章

网友评论

      本文标题:使用VBA改变Word中的复选框样式

      本文链接:https://www.haomeiwen.com/subject/ggtmactx.html