分享

自动编号转文本

 精神360 2020-08-10
  1. Sub 全文编号转文本2()
    '将文档中全部自动编号转成正常文本。
    ActiveDocument.Range.ListFormat.ConvertNumbersToText
    End Sub

    2.
    Sub 全文编号转文本()
        Dim i As List
        For Each i In ActiveDocument.Lists
            i.ConvertNumbersToText
        Next
    End Sub

    3.
    Sub 自动编号转文本,可部分,同时删除制表符()
        If Selection.Type = wdSelectionIP Then
            ActiveDocument.Content.ListFormat.ConvertNumbersToText
            ActiveDocument.Content.Find.Execute FindText:="^t", replacewith:=" ", Replace:=wdReplaceAll
        Else
            Selection.Range.ListFormat.ConvertNumbersToText
            Selection.Find.Execute FindText:="^t", replacewith:=" ", Replace:=wdReplaceAll
        End If
    End Sub

4.

Sub 自动编号转文本()
Dim n
On Error Resume Next
n = MsgBox("默认转换文档中所有项目符号、自动编号、多级列表,如果只转换某区域,请点击“取消”选中该区域后再运行", 1 + 64)
If n = 1 Then
    i = Len(Selection.Range)
    If i = 0 Then
        ActiveDocument.Content.ListFormat.ConvertNumbersToText
        MsgBox "完成"
    Else
        Selection.Range.ListFormat.ConvertNumbersToText
        MsgBox "完成"
    End If
End If
End Sub

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多