国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 辦公 > Word > 正文

自動給word文檔參考文獻添加中括號方括號的VBA代碼

2024-08-22 13:26:45
字體:
來源:轉載
供稿:網友

  下面的這一段宏代碼,在Word環境下使用,其功能是,自動給word文檔參考文獻添加中括號或方括號

  AddMarkRef Macro

  Dim parag As Paragraph

  Dim selRge As Range

  Dim rge As Range

  Dim nField As Integer

  Dim nParag As Integer

  Set selRge = Selection.Range

  MsgBox "在使用宏代碼之前您應先選擇好參考文獻?"

  ActiveDocument.ActiveWindow.View.FieldShading = wdFieldShadingWhenSelected

  For nParag = 1 To selRge.Paragraphs.Count

  Set rge = selRge.Paragraphs(nParag).Range

  rge.Select

  nField = Selection.Fields.Count

  For i = 1 To nField

  rge.Select

  If Selection.Fields.Count >= 1 Then

  With Selection.Fields(i)

  .Update

  .Select

  End With

  Selection.Cut

  Selection.InsertBefore ("[")

  Selection.Collapse Direction:=wdCollapseEnd

  Selection.Paste

  Selection.InsertAfter ("] ")

  End If

  Next i

  Next nParag

  End Sub

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 获嘉县| 宁武县| 偃师市| 安新县| 育儿| 和顺县| 锦屏县| 平舆县| 满城县| 辽宁省| 商河县| 桂东县| 陆丰市| 巴彦县| 富民县| 洪江市| 基隆市| 湾仔区| 呼图壁县| 河北省| 临泽县| 和平县| 阜城县| 应城市| 岗巴县| 天津市| 横峰县| 呈贡县| 玉溪市| 宜宾市| 澄江县| 施秉县| 邹城市| 涿鹿县| 天祝| 永昌县| 浦江县| 青神县| 新和县| 长垣县| 岳池县|