workflow docx > google docs, redirect references to group library

edited April 15, 2026
Dear all,
so, I have written this document in MS Word with active Zotero references. Now I want to continue working on the document with others using Google Docs. I have created a Zotero Group for this purpose and copied the entries referenced in the paper into that library. But how do I redirect the references in the paper to the corresponding ones in the group library? Is that necessary? If so, as I suspect, do I do that first locally with the Word document before uploading it into Google Docs? Or do I do that online with the Google Doc version? Is there a standard workflow for that?
I have found a discussion from 2019 of a similar problem (https://forums.zotero.org/discussion/79206/moving-in-text-citations-from-my-library-to-a-group-library), but I did not really understand the answer offered, and given I am planning to use Google Docs, the workflow may be different anyways.
Thanks in advance for your help!
Sebastian

In case it's relevant: I am using Zotero 7.0.32 (64-bit), the current version of Zotero Connector for Firefox (March 30, 2026) and MS Office 365. SD
  • In case it's relevant: I am using Zotero 7.0.32 (64-bit), the current version of Zotero Connector for Firefox (March 30, 2026) and MS Office 365. SD
  • The 2019 answer is still applicable -- if anything isn't clear, you'd have to say what.
  • Thanks @adamsmith — the 2019 answer is indeed valid, but did not cover my situation completely, so I wanted to come back with what I actually ended up doing, in case it’s useful to others landing on this thread.

    My situation again: a .docx written in Word with citations linked to My Library, plus collaborators who needed to edit the document in Google Docs and add their own citations through a shared group library. Two distinct problems to solve in sequence:

    1. Get every citation in the document re-pointed from My Library to the corresponding item in the group library.
    2. Get the file into Google Docs without losing the citation links during conversion.


    ## Problem 1 — relinking citations from My Library to a group library

    There’s no Zotero feature for this yet (issue #2018 on GitHub tracks it). Two practical workarounds:


    ### Approach A — @jdlea’s Word VBA macro

    Posted by @jdlea in thread 106809: https://forums.zotero.org/discussion/comment/465655/#Comment_465655. This is a very clever idea — instead of needing an explicit key-to-key mapping, it does the matching itself:

    1. Copy every cited item from My Library into the group library (drag-and-drop in Zotero).
    2. At the end of the .docx, insert a Zotero Multiple Sources citation pointing to every item in the group library.
    3. Run the macro. It loops through every field, reads the embedded JSON, builds a dictionary keyed on title (or DOI, or URL), and lets the last matching URI win. Because the Multiple Sources citation at the end has the group URIs and comes last, the group URIs are the ones written back into every earlier field.
    4. Delete the Multiple Sources citation at the end.
    5. Refresh in Zotero.
    This seems to work well; no scripting environment needed beyond Word’s built-in VBA editor. The only catch is the dependence on title-matching, which can stumble if two items have near-identical titles or if titles got edited slightly between the libraries.
    But there is still much manual work (creating a multiple-source citation at the end, which can be quite laborious if there are many references.)


    ### Approach B — direct search-and-replace inside the .docx (what I did)

    A .docx is just a ZIP archive with XML inside. Zotero stores each citation’s target as a URI in the field code, e.g.

    http://zotero.org/users/1234567/items/1234ABCD

    For an item that has been copied to a group library, the equivalent URI is

    http://zotero.org/groups/9876543/items/WXYZ9876

    …with a different 8-character key. The whole job is: build the mapping old_key → new_key, then do a literal string replacement of each URI inside the document’s XML parts. Open the result in Word, click Refresh, and Zotero re-binds the citations to the group library.

    #### Building the mapping:
    Export both libraries (My Library collection and the group library) as CSV from Zotero — right-click the collection → Export Collection → CSV. Each row has a Key column with the 8-character item key, plus Title, DOI, etc. Join the two CSVs on Title (or DOI for stricter matching) and you have your old_key,new_key table. With support by AI, I wrote a small Python script that does the join and reports any unmatched items.

    #### Doing the replacement:
    A second Python script opens the .docx as a ZIP, walks every .xml part, and string-replaces

    http://zotero.org/users//items/

    with

    http://zotero.org/groups//items/

    for every pair in the mapping. (Writes a new .docx and leaves the original untouched as backup.) The script reports per-URI replacement counts at the end, so one can see at a glance whether anything was missed.

    I sanity-checked the approach beforehand by manually editing the URI of a single citation in word/document.xml, re-zipping, and opening in Word — Zotero accepted the change cleanly and the citation pointed to the group library after Refresh. So the format is exactly what Zotero reads back.

    Both scripts (joiner + relinker) are short and well-commented; I’m happy to share them if there’s interest — let me know.


    ## Problem 2 — getting the file into Google Docs with active citations

    This was the part I had been missing. Uploading the .docx to Drive and opening it as a Google Doc silently strips the Zotero field codes — the citations become plain text. The fix is to use the official Zotero KB procedure (https://www.zotero.org/support/kb/moving_documents_between_word_processors):

    1. In Word: File → Save As… to a new filename (e.g. …-Transfer.docx).
    2. Zotero tab → Document Preferences → Switch to a Different Word Processor… Zotero replaces each citation with a long code and adds a banner to the document. Looks alarming, but is correct.
    3. Save.
    4. In a browser, open a fresh empty Google Doc and use File → Open → Upload from inside that doc(!) to bring in the Transfer.docx. (This is the critical bit — uploading the file directly to Drive and double-clicking doesn’t do the same thing.)
    5. In the opened Google Doc: Zotero menu → Refresh. The Connector reads the transfer codes, talks to local Zotero, finds the items in the group library, and rebuilds the document with live Google-Docs Zotero citations.
    6. After that, collaborators with their own Zotero + Connector + group membership can add and edit citations exactly as if the document had been started in Google Docs from the beginning.

    Hopefully this is useful for the next person who finds this thread.

    Sebastian
Sign In or Register to comment.