How to Automatically Change Citation Color in Word (e.g., Blue) Using Zotero + Macro

Hi everyone,

I’d like to share a tip that might be useful for others working with Zotero and Microsoft Word.

If you want to automatically change the color of your in-text citations (for example, to blue, as often seen in scientific papers), here's a simple way to do it using a macro in Word.

Step-by-step: Make Zotero citations appear in blue

1. Press Alt + F11 in Word to open the VBA editor.

2. Insert a new module: Insert > Module.

3. Paste the following code:

Sub ColorZoteroCitationsBlue()
Dim field As Field
For Each field In ActiveDocument.Fields
If InStr(field.Code.Text, "ADDIN ZOTERO_ITEM") > 0 Then
field.Result.Font.Color = RGB(0, 102, 204) ' Customize RGB as desired
End If
Next field
MsgBox "Zotero citations are now blue!"
End Sub


4. Close the editor (Alt + Q).

5. Run the macro from Word: View > Macros > View Macros, select ColorZoteroCitationsBlue, and click Run.

You can also [optionally] add this macro as a custom button in the Word ribbon for quick access.

Notes:

You can replace the RGB color with any other value (e.g., RGB(102,178,255) for light blue).

This only affects in-text citations, not the bibliography.

The macro will need to be re-run if you refresh Zotero fields.

Do not unlink citations unless you're done editing — this works while citations are still active Zotero fields.

Hope this helps others looking to improve the appearance of their documents!

Best,
[Your Name or Username]
Sign In or Register to comment.