Getting the Word plugin work with international office versions

36 views
Skip to first unread message

jan hendrik schreier

unread,
Apr 20, 2012, 12:16:52 PM4/20/12
to zoter...@googlegroups.com

Hi there,

After some hours I finally managed to get Zotero and the word plugin compiled and was able to test the issue that caused me going on this journey: the issue with non English Word and Style sheets (described here: http://forums.zotero.org/discussion/22937/wordplugin-kills-formatting-in-nonus-versions/#Item_3 and here in general: http://www.thedoctools.com/index.php?show=mt_create_style_name_list).

Right now the best solution for this would be to pass not the string “Bibliography” in the Plugin but user the enumeration value WdBuiltinStyle.wdStyleBibliography (or it’s numeric value -266). Unfortunately this solution would not work with Office 2003 (see here: http://www.thedoctools.com/downloads/DocTools_List_Of_Built-in_Style_English_Danish_German_French.pdf)

As an easy solution I would suggest to add a variable to the variable in about:config.  If my programming skills would be good enough, I’d provide a patch now but that’s not the case. So I’d be happy for some advice. Basically what I would need is the ability to access about:config variables from the files zoteroWinWordField.cpp, zoteroWinWordDocument.cpp, and zoteroWinWordDocument.h in the WinWord plugin.

Looking forward for your support and wish you all a nice weekend!

Jan

Simon Kornblith

unread,
Apr 20, 2012, 5:00:38 PM4/20/12
to zotero-dev
Thanks for working on this! It would probably be both easier and
better to check the Word version dynamically and to use the
enumeration value automatically for Word 2007+, instead of making
things depend on a hidden variable. There's already an isWord2010
private property on zoteroWinWordDocument. This could be replaced with
a major version number and made public so that zoteroWinWordField can
access it.

Feel free to do this yourself if you're up for it. Otherwise, I'll
probably get around to it sometime in the next few weeks.

Simon

On Apr 20, 12:16 pm, jan hendrik schreier <jhschre...@googlemail.com>
wrote:
> Hi there,
>
> After some hours I finally managed to get Zotero and the word plugin
> compiled and was able to test the issue that caused me going on this
> journey: the issue with non English Word and Style sheets (described here:http://forums.zotero.org/discussion/22937/wordplugin-kills-formatting...here in general:http://www.thedoctools.com/index.php?show=mt_create_style_name_list).
>
> Right now the best solution for this would be to pass not the string
> “Bibliography” in the Plugin but user the enumeration value
> WdBuiltinStyle.wdStyleBibliography (or it’s numeric value -266).
> Unfortunately this solution would not work with Office 2003 (see here:http://www.thedoctools.com/downloads/DocTools_List_Of_Built-in_Style_...
> )

jan hendrik schreier

unread,
Apr 23, 2012, 10:10:43 AM4/23/12
to zoter...@googlegroups.com
Thanks for your answer. The function was a good hint but my major problem was my inability to send the enumeration from C++ to Word and not have the value interpreted as String so I'll sit tight and look forward for you doing it. Best regards from Munich! Jan

Simon Kornblith

unread,
Apr 23, 2012, 5:45:10 PM4/23/12
to zotero-dev
I may have fixed this, but I have no way of testing since I don't have
a non-English Word install. Try the latest code, either from github or
via the dev XPI (http://www.zotero.org/support/
dev_builds#word_processor_plugins_development_xpis).

Simon

On Apr 23, 10:10 am, jan hendrik schreier <jhschre...@googlemail.com>
wrote:
> Thanks for your answer. The function was a good hint but my major problem
> was my inability to send the enumeration from C++ to Word and not have the
> value interpreted as String so I'll sit tight and look forward for you
> doing it. Best regards from Munich! Jan
>
> Am Freitag, 20. April 2012 23:00:38 UTC+2 schrieb Simon Kornblith:
>
>
>
>
>
>
>
>
>
> > Thanks for working on this! It would probably be both easier and
> > better to check the Word version dynamically and to use the
> > enumeration value automatically for Word 2007+, instead of making
> > things depend on a hidden variable. There's already an isWord2010
> > private property on zoteroWinWordDocument. This could be replaced with
> > a major version number and made public so that zoteroWinWordField can
> > access it.
>
> > Feel free to do this yourself if you're up for it. Otherwise, I'll
> > probably get around to it sometime in the next few weeks.
>
> > Simon
>
> > On Apr 20, 12:16 pm, jan hendrik schreier <jhschre...@googlemail.com>
> > wrote:
> > > Hi there,
>
> > > After some hours I finally managed to get Zotero and the word plugin
> > > compiled and was able to test the issue that caused me going on this
> > > journey: the issue with non English Word and Style sheets (described
> > here:
> >http://forums.zotero.org/discussion/22937/wordplugin-kills-formatting...general:

jan hendrik schreier

unread,
Apr 24, 2012, 4:34:39 AM4/24/12
to zoter...@googlegroups.com
Hi Simon,

you refer to this github:
right? 

Is it possible that you did not publish your update to the server? I'm not totally familiar with GIT (still like SVN) but to me it seems the last change was on March 17?!

the XPI did not produce the expected result but it could be because I'm using Zotero standalone and as far as I could see it, you compiled the dll in the XPI for Gecko 13 only. I also changed the chrome.manifest file to import the dll from the components-13.0 directory but this also did not produce the desired result.

Simon Kornblith

unread,
Apr 24, 2012, 11:43:22 PM4/24/12
to zotero-dev
Sorry, I forgot to push the commit. It should be updated now.

Simon

On Apr 24, 4:34 am, jan hendrik schreier <jhschre...@googlemail.com>
wrote:

jan hendrik schreier

unread,
Apr 25, 2012, 10:17:29 AM4/25/12
to zoter...@googlegroups.com
Hi Simon,

works marvelous with one exception: Word 2007 is version 12 not 13. after I changed this and compiled again it worked for me :)

so you got to change the if-condition for wordVersion <= 13 to 12 in zoteroWinWordField.cpp and zoteroWinWordDocument.cpp

Version number 13 was skipped due to superstition (and to drive any 3rd party developer mad...)

BR! 

Jan
Reply all
Reply to author
Forward
0 new messages