[Juris-M] Word plugin not communicating in Word 2013 for Windows + display issues

I am trying out the new standalone Juris-M and it's working well but the Word plugin is not. I see both the ZOTERO section on the ribbon and the smaller buttons under ADD-INS, but trying to insert a citation with either produces a "Word could not communicate with Zotero" error.

(The plugins were installed by Juris-M).

A separate issue, one that may not be limited to Juris-M: I've noticed a display problem when the plugin is installed that affects the usability of Word even when there are no references in the document. When the plugin in enabled, text selected with the mouse or keyboard is no longer consistently highlighted: it's still selected, as can be verified by changing the font or copy and pasting it, but its gray background disappears as does the floating formatting toolbar that normally appears.

This seems to be a side-effect of the work the plugin is doing in the background every time the selection is changed. I've found a way of fixing it by turning screen updating off and back on in the UpdateRibbon class event handler:

Private Sub UpdateRibbon()
If Not initialized Then
Exit Sub
End If

On Error GoTo ErrHandler

Application.ScreenUpdating = False ' Stop redrawing the window

Dim isCitation As Boolean
Dim isBibliography As Boolean
Call getZoteroFieldAtSelection(isCitation, isBibliography)
Dim hasFields As Boolean
hasFields = documentHasZoteroFields()

If isCitation <> selectionIsCitation Or _
isBibliography <> selectionIsBibliography Or _
hasFields <> documentHasFields Then
selectionIsCitation = isCitation
selectionIsBibliography = isBibliography
documentHasFields = hasFields
ribbonUI.Invalidate
End If

ErrHandler:
ThisDocument.Saved = True
Application.ScreenUpdating = True ' Let the window update again
End Sub
  • edited September 8, 2015
    Bruce,

    Which OS are you using? (Ah, sorry, Windows - it was nearly cut off in the subject line.) I assume that you have tried reinstalling the plugin to Word via the button in Preferences -> Cite?
  • Windows 10 (64-bit, with Office 2013 32-bit). And yes, I've tried reinstalling.
  • edited September 8, 2015
    Just two thoughts so far. The first is just to check the Knowledge Base page on the error (which you may already have done, but just in case):

    https://www.zotero.org/support/word_processor_plugin_troubleshooting#communication_error_or_non-responsive_plugin_buttons

    The second thought is that the app name may be an issue. I set this to "Juris-M" in the release, but in some interprocess communications, counterparts expect it to be "Zotero" or "Firefox." I'm not sure if this affects the Word for Windows integration plugin, but I'll shift the name back in a fresh release of the Windows installer. Not sure if it will help, though.

    I'll see if I can reproduce the failure. A colleague has a Windows 10 machine, I'll check with that if I can't make things fail on the Windows 8 machine that I have regular access to.
  • (A further thing to try might be to remove the macro plugin from Word, and then reinstall from Cite preferences. That was reported to have helped in a similar case.)
  • Figured it out. Digging in the Zotero.dotm, I found a hardcoded list of app names in ZoteroCommand in the Zotero module:
    appNames(1) = "Zotero"
    appNames(2) = "Firefox"
    appNames(3) = "Browser"
    appNames(4) = "Minefield"

    Changing "Minefield" to "Juris-M" did it and it works perfectly now. Long term you'll probably want to have that value added to the standard release of the plugin.
  • Excellent, thanks! So the culprit was the app name. It's been fixed in the Linux and Mac releases, I'm about to go in to school to rebuild the Windows version.
  • edited September 8, 2015
    I've revised the Windows client. If you reinstall with the latest, it should work without the fix. (I think.)
  • Will try. Incidentally I noticed some more hard coding to Firefox in the ZoteroCommand sub:
    If Err.LastDllError = 5 Then
    If Dir("C:\Program Files\Mozilla Firefox\firefox.exe") <> "" Then
    Call Shell("""C:\Program Files\Mozilla Firefox\firefox.exe"" " & args$, vbNormalFocus)
    ElseIf Dir("C:\Program Files (x86)\Mozilla Firefox\firefox.exe") <> "" Then
    Call Shell("""C:\Program Files (x86)\Mozilla Firefox\firefox.exe"" " & args$, vbNormalFocus)
    End If
    End If
    With Juris-M those errors will simply be ignored--or, worse, raised in Firefox even when they're produced in the standalone! I don't know if it would be able to produce the appropriate dialogue.
  • edited September 8, 2015
    The plugin code is from Zotero, so if there are any anomalies from that particular code, they should turn up in the official distribution.

    Looking good so far. The next interesting watershed will be the arrival of Zotero 5.0, which will have a lot of new code that impacts the Juris-M extensions. I've been working on the migration, and most of the hard stuff is done, and I've set it aside for now—I'll resume work on it when the beta is released, and I think we'll be on schedule to adapt to the new sync architecture that will become mandatory shortly after. Touch wood.
  • Hi Frank,

    First, thanks for creating Juris-M. I love it.

    Until this morning, I ran Juris-M and the Juris-M plugin that shipped with Juris-M, without incident. I have Windows 10 and World 2016 (32 bit). Then, this morning, Juris-M warned me that it couldn’t update itself, and advised me to download the latest standalone version. When I downloaded and installed the latest standalone version, I found that the Word plugin could not communicate with Zotero (same error message as Bruce, above).

    I tried editing Zotero.dotm to add “Juris-M” in place of “Minefield” in the list of application names. Unfortunately, this change didn’t appear to have any impact on the issue.

    Also, I attempted disabiing the default version of the Word plugin that shipped with Juris-M, and instead adding to my Juris-M standalone instance the version of the Juris-M Word Plugin downloaded directly from github today (which was verison 3.5.2.m4). However, when I try to load this version of the Word Plugin into Juris-M, the result is an error message ("The add-on "Juris-M Word for Windows Integration" could not be installed. It may be incompatible with this version of Zotero Standalone.") and the plugin does not load. As a result, I am still using the plugin version that shipped with Juris-M standalone (that’s 3.5.2.SA.4.0.28.7m52820ea77).

    As a test, I also installed Firefox on this computer with the standard Zotero plugin, and synced my library (using Firefox’s profile directly, independently of Juris-M). When Firefox is running, the Word plugin appears to interface directly with Zotero in Firefox, as expected. I just can’t seem to get the plug-in to communicate with Juris-M.

    Any ideas of things to try?

    Thanks,

    David
  • Since last year I've been able to gear up a little. I have Windows 10 and Word 2013 on a dev workstation at the office, so I should be able to check into this directly tomorrow afternoon (15 hours from now, give or take).

    I've been working on a fresh release. If there are problems with the current release (due to a Firefox upgrade?), I can push out the new version a little early. More soon.
  • As an interim report, the release in testing, running the Juris-M plugin with Juris-M standalone will foreground the standalone client if Firefox is started after JM Standalone, and the word processor connection is working normally. So that end of things should be good.

    In the new version, I've made some changes that greatly simplify the code in law style modules. Before pushing out an update, I'll need to make some changes to the CSL code in existing modules, to make them work with the new configuration. The changes are straightforward, though, and should be done by the end of the day tomorrow.
  • Thanks for the update and for your work on this! I should add that after posting to the forum last night, I added each Juris-M element to my (working) Firefox Zotero instance. It now appears that I can use the Juris-M functionality via Firefox, although I haven't yet tested it beyond a single first citation in a clean Word doc.
  • An update: the above fix, changing the hardcoded list of thread titles, is necessary in the latest version of Juris-M. The proper text for the title is "jurism", so
    appNames(1) = "Zotero"
    appNames(2) = "Firefox"
    appNames(3) = "Browser"
    appNames(4) = "Minefield"
    Should becomeappNames(1) = "Zotero"
    appNames(2) = "Firefox"
    appNames(3) = "Browser"
    appNames(4) = "jurism"
    (Or you can add a fifth entry and tweak the add-in to iterate through that as well). Ultimately, it would be great if the standard Zotero plugin could be updated to include jurism by default.
  • Just to note that the need for this workaround will definitely go away with the next release. Apologies for the inconvenience over this - I was borrowing machines to do the builds while putting the early SA kit together (not exactly best practice). The lab is in better shape now, there should be fewer unpleasant surprises.
Sign In or Register to comment.