Last active
January 17, 2016 12:32
-
-
Save d1manson/228cba8c9ca44c9ac7bc to your computer and use it in GitHub Desktop.
set color of zotero references in MSWord using VBA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub FormatZoteroRefs() | |
Set objUndo = Application.UndoRecord | |
objUndo.StartCustomRecord ("Format Zotero refs") | |
For Each myStoryRange In ActiveDocument.StoryRanges | |
For ii = 1 To myStoryRange.Fields.Count | |
If InStr(1, LTrim(myStoryRange.Fields(ii)), "ADDIN ZOTERO_ITEM CSL_CITATION") = 1 Then | |
Set rng = myStoryRange.Fields(ii).Result | |
rng.Font.ColorIndex = 9 ' this seems to be dark blue | |
End If | |
Next ii | |
Next myStoryRange | |
objUndo.EndCustomRecord | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment