利用word宏命令来自动化缩写期刊名称

投稿的时候往往需要调整参考文献格式为期刊需要的格式,并且往往期刊名称为缩写的。
本文利用word的宏命令自动化缩写参考文献,只要提前设置好缩写的模板,即可实现对期刊名称的缩写,宏脚本目前实现了

  1. IEEE GRSL
  2. IEEE TSP
  3. IEEE TAES
  4. IEEE SPL

的缩写,其余期刊同理

Sub A缩写参考文献()
'
' 缩写参考文献 宏
' 可修改 IEEE GRSL  TSP  TAES SPL
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
   
    
' IEEE GRSL

    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Italic = True
    With Selection.Find
        .Text = "IEEE Geoscience and Remote Sensing Letters"
        .Replacement.Text = "IEEE Geosci. Remote Sens. Lett."
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchByte = True
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    
    'IEEE TSP
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Italic = True
    With Selection.Find
        .Text = "IEEE Transactions on Signal Processing"
        .Replacement.Text = "IEEE Trans. Signal Process."
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchByte = True
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    
    ' IEEE TAES
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Italic = True
    With Selection.Find
        .Text = "IEEE Transactions on Aerospace and Electronic Systems"
        .Replacement.Text = "IEEE Trans. Aerosp. Electron. Syst."
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchByte = True
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    
    ' IEEE SPL
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Italic = True
    With Selection.Find
        .Text = "IEEE Signal Processing Letters"
        .Replacement.Text = "IEEE Signal Process. Lett."
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchByte = True
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    
End Sub

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章