Skip to main content

I have a Word document with a checkbox control, and I need to mark it as checked in certain situations.  Is there any way to do that using the Word Documents Event?

The project sounds like it would be interesting.


 


I would look at inserting a Macro based on a SharePoint (yes/no) column.  Insert QuickParts, Document Property, yes/no


 


You can then work with a SharePoint update event to communicate with a K2 workflow.  


Hi cjmoran,


 


Can you just verify the following for me please:


 


What version of K2 are you using currently?


What are you using to design the workflow {K2 Studio, K2 for visual studio, etc.}?


 


The reason for this is, I might have a way of doing this depending on what you are using.


 


Also can you just verify for me that I am understanding your question correctly:


You want to upload a word document and then by checking a checkbox you want it to check in the document.


 


Thank you


 


Regards


Quintin


Hi cjmoran, 

 

We managed to do this by creting a server event, where we used the WordDocumentHelper class update the values. The key thing was using the unicode characters '☒' and '☐' as the parameter values. Microsoft Word seems to use these same values by default to render the check boxes.

 

We ended up using a server event because of the large number of content controls in the Word document, but I believe passing those characters as parameters to a Word Documents Event would also do the trick.

 

WordDocumentHelper wdHelper = new WordDocumentHelper(file);

if (condition) {

  updatedFile = wdHelper.UpdateContentControl("MyCheckBox", "☒");

}

else {

  updatedFile = wdHelper.UpdateContentControl("MyCheckBox", "☐");

}

 

I hope his helps!

 

BR, 

Tuomas

 


Reply