DEV Community

Oscar Sun(孫守真字任真)
Oscar Sun(孫守真字任真)

Posted on

Answer: COM exception - this document is locked for editing - but it isn't

Your description is too general, and I do not know where the problem lies. After trying to reproduce the scenario in your code as follows, I did not encounter any errors:

    public partial class ThisDocument
    {
        private void ThisDocument_Startup(object sender, System.EventArgs e)
        {
            this.Application.ActiveDocument.Range().InsertAfter("...")
            AddComment(10, 20, "南無阿彌陀佛");
            AddComment(10, 20, "阿彌陀佛");

Top comments (0)