public void addDocToMap(SoylentPanel sp) { Word.Document doc = this.Application.ActiveDocument; soylentMap[doc] = sp; }
void Application_DocumentChange() { Word.Document doc = this.Application.ActiveDocument; // If the document is already open, don't worry about it. If not (e.g. created a new document, loaded old), set up its panel if (!soylentMap.Keys.Contains<Word.Document>(doc)){ SoylentPanel soylent = new SoylentPanel(); HITView = this.CustomTaskPanes.Add(soylent, "Soylent"); HITView.VisibleChanged += new EventHandler(hitviewVisibleChanged); //HITView.Visible = true; addDocToMap(soylent); } }