1 2 3 4 5 6 7 8
| Sub CitingColor() For i = 1 To ActiveDocument.Fields.Count '遍历文档所有域 If Left(ActiveDocument.Fields(i).Code, 4) = " REF" Or Left(ActiveDocument.Fields(i).Code, 14) = " ADDIN EN.CITE" Or Left(ActiveDocument.Fields(i).Code, 31) = " ADDIN ZOTERO_ITEM CSL_CITATION" Then 'Word自带的交叉引用的域代码起始4位是" REF"(注意空格),EndNote插入的引用域代码的起始14位是" ADDIN EN.CITE",Zotero插入的引用域代码的起始31位是" ADDIN ZOTERO_ITEM CSL_CITATION"。根据需求可添加其他类型。 ActiveDocument.Fields(i).Select '选中上述几类域 Selection.Font.Color = wdColorBlue '设置字体颜色为蓝色,也可以使用以下代码设置为任意颜色Selection.Font.Color = 12673797 End If Next End Sub
|