WORD VBA 操作WORD 文本框

'实例1:批量删除WORD文本框中的内容
    Sub test1()
        Dim sha As Shape
        For Each sha In ActiveDocument.Shapes
            sha.TextFrame.TextRange.Delete
        Next
    end sub
'实例2:批量删除WORD文本框而保留文字
    Sub test()
        Selection.EndKey unit:=wdStory
        Dim Shp As Shape
        For Each Shp In ThisDocument.Shapes
            Selection.TypeText Text:=Shp.TextFrame.TextRange.Text
            Shp.Delete
        Next
    End Sub  

你可能感兴趣的:(WORD-VBA)