Divide by zero
 Sunday, May 11, 2008
Wikipediaise - a c# VSTO Word addin

Wikipediaise - What is it?

Wikipediaise is a Visual Tools for Office addin (VSTO) developed in Microsoft Visual Studio 2008 as an addin for Microsoft Word. It is written in C#.  It  was designed to hyperlink acronyms and jargon  to Wikipedia.

I do a lot of technical documentation for my work, and the IT industry being what it is, the documents end up with a ridiculous number of acronyms. To make life easier, we usually put an abbreviation section at the top of the document, but this is a time consuming process to go thru every time, so I automated it. Additionally I added another method which will seek out the first occurrence of an abbreviation or acronym, and hyperlink it. First I will describe how this works, then how to use and customize the functionality.

Initially Wikipedia was used as the reference point, as it is an excellent reference point for technical information. After a while it became clear that many acronyms were better documented elsewhere, or in internal company documents, so I added the ability to use alternative reference sources.

Note that although I refer to acronyms, the addin is good for jargon and technical terms as well.

The following images show a before and after shot of a simple document, additionally it shows the document with an acronym table inserted at the top.


Figure 1 - Before shot of a Word document with acronyms and jargon to be hyperlinked


Figure 2 - The same document after it has been hyperlinked


Figure 3 - The same document, hyperlinked, and with an acronym table inserted at the beginning

How it works

The application comes with an embedded XML file with a set of pre-defined acronyms. This serves as an example only. The application will look in the %mydocuments% folder for a file called wikipediaise.dic. If this file exists it will override the embedded file, so the application can be customized for most requirements.

Format of the XML file

There are two elements available in the wikipediaise.dic file shown below.

Table 1 - Elements available in wikipediaise.dic

Element

Description

Comment

excludeStyle

Lists a Word style to be excluded from the process

This could be a built in style or a user defined style. If a word is in this style it will not be hyperlinked.

entry

Contains a mandatory key term that will be searched for. Optional attributes will be described later.

This text will be searched for in a case sensitive manner. If the term is found in the middle of a word, it will still be matched. For this reason, position longer superset acronyms earlier e.g. place https before http

The excludeStyle element has no attributes, so just looks like this


Figure 4 - excludeStyle element example

The entry element has attributes, these are described below.

Attribute name

Mandatory

Description

Comment

key

Yes

The term that will be searched for and hyperlinked.

Case sensitive. position longer superset acronyms earlier e.g. place https before http

wikipediaEntry

No

This attribute is only used for entries in Wikipedia where the page name is not the same as the attribute.  E.g. the entry in Wikipedia for Apache has a page name of Apache_HTTP_Server

 

description

No

This will be used as a tooltip when a hyperlink is created in Word. It will also be used in the acronym table if that feature is used,

 

url

No

This is an alternative URL if Wikipedia is not to be the source of reference.

 

Table 2 - entry element attributes

Focas.NET.wikipediaise.zip (21.4 KB)
Sunday, May 11, 2008 5:29:29 PM (AUS Eastern Standard Time, UTC+10:00)   #    Comments [3]  Downloads | VSTO | Word 2007
link to del.icio.us link to reddit link to StumbleUpon link to Facebook Bookmark to Google
Wednesday, October 15, 2008 9:59:17 PM (AUS Eastern Standard Time, UTC+10:00)
Nifty Add-in. How do you install it?
James
Wednesday, October 22, 2008 6:20:04 AM (AUS Eastern Standard Time, UTC+10:00)
Agree with above- this seems nice,but how can I get it to load in Word 07?
Andy
Thursday, October 23, 2008 12:50:13 PM (AUS Eastern Standard Time, UTC+10:00)
Hi, Thanks for commenting. I set this up initially as a source code example for .NET developers, so assumed that anyone using it would have Visual Studio installed. This was a bad assumption as it is clearly useful to all sorts of people. If you do have Visual Studio 2008, you can open the solution and run it, then it will always appear in your Addin tab of word afterwards. If you don't have Visual Studio then I will try to post sometime this week a setup program that will install it.
Thanks,
Mark
Comments are closed.