I created a plugin for Word for more than 2 years ago. After the new Word version 2016 on Windows. I'm experience some problems with creating comments.
How to recreate the problem:
Create a simple word addin project in Visual Studio. Add a ribbon to the project. Add a button to the ribbon that on click create a comment.
Run the addin. In Word 2016 under the tab review. Turn show comments off and set markup to simple markup.
Now add two comments with the button in the plugin. Then add a comment between the two comments with the built in comment system in word. Turn on show comments again under the tab Review. Now add a comment to the end of the document. Now you should see the new comment is empty and the text is added to the first comment of the document.
If you turn on show comments before you add any comments to the document everything should work as expected. If you recreate the above in a older version than Word 2016 everything works.
My code
Here is my basic code for creating the comment
private void button2_Click(object sender, RibbonControlEventArgs e)
{
Document oDocument = Globals.ThisAddIn.Application.ActiveDocument;
Selection curSel = Globals.ThisAddIn.Application.Selection;
oDocument.Comments.Add(curSel.Range, "My comment");
}
I hope someone can help with this problem. I have now tried everything from changing version of the vsto and creating different project with different code.