text 批量修改NCBI-18-7-20

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 批量修改NCBI-18-7-20相关的知识,希望对你有一定的参考价值。

Sub supNcbi(ByVal control As IRibbonControl)
Call layout_search_replace.jump_to_reference_section
With selection.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Font.Italic = False
    .Text = "^13[A-Z]*[A-Z]\. [A-Z][a-z]"
    .MatchWildcards = True
    .Replacement.Text = ""
    .Wrap = wdFindStop
    Do
    .Execute
    If Not .Found Then
    Exit Do
    End If
    If .Found Then
    Dim aimt As String
    aimt = selection.Range.Text
        If existCrlf(aimt) = False And IsNCBI(aimt) = False And IsNCBI1(aimt) = False And IsNCBI2(aimt) = False Then
        
        Dim myrange As Range
        
        Set myrange = selection.Range
        
        myrange.Select
        
        myrange.SetRange selection.Range.Start + 1, selection.Range.End - 3
        
        myrange.Select
        
          If InputBox("Is this ncbi?", "NCBI", "yes", 300, 300) = "yes" Then
          MsgBox Len(aimt)
              Call kr_deck.kr_ncbi
              selection.collapse IIf(selection.Next(wdCharacter, 1) = ";", wdCollapseEnd, wdCollapseStart)
              
              Else
              selection.collapse wdCollapseEnd
          End If
        selection.collapse wdCollapseEnd
        Else
        
        End If
    End If
    Loop
End With

End Sub
Function IsNCBI(str As String) As Boolean
   Dim reg As Object
    Set reg = CreateObject("VBScript.Regexp")
        
    Dim is_exist As Boolean
    With reg
        .Global = True
        .Pattern = "[A-Z][a-z]\, [A-Z][a-z]"
        is_exist = .test(str)
    End With
    IsNCBI = is_exist
End Function


Function IsNCBI1(str As String) As Boolean
   Dim reg As Object
    Set reg = CreateObject("VBScript.Regexp")
        
    Dim is_exist As Boolean
    With reg
        .Global = True
        .Pattern = "[^A-Za-z\.]\, [A-Z]"
        
        is_exist = .test(str)
    End With
    IsNCBI1 = is_exist
  
End Function
Function IsNCBI2(str As String) As Boolean
   Dim reg As Object
    Set reg = CreateObject("VBScript.Regexp")
        
    Dim is_exist As Boolean
    With reg
        .Global = True
        .Pattern = "\;"
        is_exist = .test(str)
    End With
    IsNCBI2 = is_exist
  
End Function

以上是关于text 批量修改NCBI-18-7-20的主要内容,如果未能解决你的问题,请参考以下文章

sublime text怎么批量修改

批量修改文件内容

批量修改图片的尺寸(c#)

批量修改样式及全选反选

Unix时间戳转换怎样在Excel批量修改

wordpress不用插件实现批量替换文章内容中的旧地址