title: Start inking in Word
body: <p>I've developed a VSTO Addin for Word a few yeas ago. It uses the ink tool, so the user can write a signature directly on the document. I coded it in Visual Basic, because as of the time I didn't knew it better. Today i would take C#. I'm not a professional.</p>
  
  <p><strong>How it works</strong></p>
  
  <ol>
  <li>When the user opens a document, the addin looks for a certain keyword. It has about 30 chars and is hidden in the document.</li>
  <li>If the keyword is found, it scrolls to the signature field and starts the inking tool, so the user can place the signature with a pen (prefered) or finger.</li>
  <li>When the document is closed, it will be automatically uploaded to a server where it is stored as a pdf.</li>
  </ol>
  
  <p>So: Open - Signate - Close. No other interaction is required.</p>
  
  <p><strong>The weak point is</strong>, I use CommandBars.ExecuteMso to do this. Now and then Microsoft changes something 
  in the Ribbon Tab.</p>
  
  <p><strong>I've used this in the last years</strong></p>
  
  <p>For Word 2010 and 2016</p>
  
  <pre><code>Application.ActiveDocument.CommandBars.ExecuteMso("InkingStart")
  </code></pre>
  
  <p>For Word 365 - build 1803</p>
  
  <pre><code>Application.ActiveDocument.CommandBars.ExecuteMso("DrawInkMode")
  </code></pre>
  
  <p>For Word 365 - build 1806</p>
  
  <pre><code>Application.ActiveDocument.CommandBars.ExecuteMso("FingerPaintingMode")
  </code></pre>
  
  <p><strong>Unfortunately it doesn't work anymore since build 12527.20194</strong> (<a href="https://support.office.com/en-us/article/what-s-new-in-microsoft-365-95c8d81d-08ba-42c1-914f-bca4603e1426?ui=en-US&amp;rs=en-US&amp;ad=US" rel="nofollow noreferrer">https://support.office.com/en-us/article/what-s-new-in-microsoft-365-95c8d81d-08ba-42c1-914f-bca4603e1426?ui=en-US&amp;rs=en-US&amp;ad=US</a>)</p>
  
  <p>In this build they added a lasso tool. When I execute CommandBars.ExecuteMso("FingerPaintingMode"), the lasso tool is active and not the pen.</p>
  
  <p><a href="https://i.stack.imgur.com/YQk1b.png" rel="nofollow noreferrer">InkToolbox_lasso</a></p>
  
  <p>You can execute this code as VBA in Word to see what i mean.</p>
  
  <pre><code>Sub InkTest()
      Application.ActiveDocument.CommandBars.ExecuteMso ("FingerPaintingMode")
  End Sub
  </code></pre>
  
  <p>The weird thing is, when you physically click on FingerPaintingMode, the pen is active and not the lasso.</p>
  
  <p><a href="https://i.stack.imgur.com/0q0Em.png" rel="nofollow noreferrer">InkToolbox_pen</a></p>
  
  <p><strong>I think of two possible solutions</strong></p>
  
  <ol>
  <li>Use a ink object directly and don't go over the ribbon. My preferred option, but im unable to find a way for this. <a href="https://docs.microsoft.com/en-us/office/vba/api/overview/word/object-model" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/office/vba/api/overview/word/object-model</a></li>
  <li>Select a Pen in the InkToolbox in the TabDrawInk tab. But it's a control type. So I can't use ExecuteMso. How could I do that?</li>
  </ol>