K2 blackpearl 4.6.9 has an awful lot of features built in for SharePoint® 2013 support. There is a bevy of wizards for library, list, document set, and document manipulation — copying, moving, changing properties — but the K2 Word® Documents Event wasn’t invited to the party.

The 2007 and 2010 Word Documents Event is a glorious thing because it allows for manipulation of content controls in Word documents hosted in SharePoint via OpenXML. The secret in the sauce is the Word Automation Services (WAS), which is run through SharePoint. WAS also handles Word document conversions to Portable Document Format (PDF) and to earlier versions of Word.

For me the biggest feature of the Word Documents Event is in the content controls. Microsoft Word allows for special fields called content controls to be placed within Word templates. Consider a basic approval process scenario. Let’s say purchase orders have to be approved by people at three levels, and that an audit department requires a record of who signed off and when. A Word Documents Event is perfect for this (given the presence of SharePoint 2010). At the end of the process, these events can insert the names of signatories and the datetimes of their actions into a Word template. Together with other SharePoint events, the completed template can be placed in a specific library, and permissions restricted to ensure the data cannot be changed. One of my first K2 projects involved a scenario of this kind.

Microsoft changed the paradigm of SharePoint starting with its 2013 release. K2 connects very differently to SharePoint in the new, app oriented world than it did in previous versions.

As of today, K2 does not have a SharePoint 2013-based Word Documents Event (though it has been requested as a feature). Fortunately, not all is lost, though — you can use the Word Documents Event in a SharePoint 2013 environment in a limited capacity.

For example, I can use the Word Documents Event to populate a context control from text —

K2-Word-Document-Event (1)

In this case, I want to insert a client company name into a content control (called “client”). For this specific tag, I want to convert the client name to all upper case letters.
K2-Word-Document-Event (2)

The key to making this wizard work in a SharePoint 2013 environment is to use the library’s network location on the Document Location panel of the wizard. Here, I must specify the network path along with the file name and the name of the content control.

K2-Word-Document-Event (3)

Other features of the Word Document Event include inserting content from other Word documents located on SharePoint into the target document. Although we can get away with identifying the target documents through network shares, we can’t do the same for the source documents. Attempts to do so produce Invalid URI exceptions.

I’ll continue to look for workarounds until K2 announces a new and improved Word Documents Event Wizard.

I freaked out a little in my first look at K2 blackpearl 4.6.9 — I didn’t see the Environment Fields node in the Object Browser.

What?! No Environment Fields Node in the Object Browser?!
What?! No Environment Fields Node in the Object Browser?!

Oh no! Why would they take away the environment fields? I RAVE about these things, and for good reason — they allow for string values to be injected into a process at runtime. I use this magic in the form of e-mail text and other data the business might want to tweak at will, because it saves me from having to recompile and redeploy the solution — a workflow process will grab the value when it needs it.

Fortunately, one of my team members was able to talk me down from the ledge: Environment Fields are still very much a part of blackpearl — the folder just won’t exist until you create an environment field.

Here’s how: Open your blackpearl project, and navigate to the object browser. Right-click on any of the existing nodes, and click on Add new field… .

Add New Field
Add New Field

You should see the familiar Add New Field dialog appear. Here’s the key: Select Miscellaneous Field in the Item Type drop down list. Name your field and give it a value. Fill in the Field Description field for extra credit and click the black OK button in the dialog’s lower right corner.

The Add New Field Dialog
The Add New Field Dialog

The Object Browser should refresh. A wild Fields node appears!

The Object Browser, complete with Fields node
The Object Browser, complete with Fields node

It’s super effective!

Expand the Fields node to see your field. Hover over the field to see the string value.
Expand the Fields node to see your field. Hover over the field to see the string value.

By the way, if you remove the single Environment Field you just created, the Fields node will disappear again.

 

At this early date there seems to be conflicting information out regarding the new blackpearl’s support for Microsoft Internet Explorer (IE) 11.

As of yesterday, the Compatibility Matrix shows IE 11 as unsupported. Yet the New Features List for blackpearl 4.6.9 says it IS supported, and offers this KB article with instructions for a workaround to allow the K2 Workspace and other portals to render correctly in the browser.