Ejemplo n.º 1
0
 void ThisDocument_SelectionChange(object sender, Microsoft.Office.Tools.Word.SelectionEventArgs e)
 {
     if (e.Selection.Characters.Count > 0)
     {
         System.Windows.Forms.MessageBox.Show("The selection in the document has changed.");
     }
 }
Ejemplo n.º 2
0
        void ThisDocument_SelectionChange(object sender, Microsoft.Office.Tools.Word.SelectionEventArgs e)
        {
            var s = Globals.ThisAddIn.Application.Selection.Range.Paragraphs[1].Range.get_Style().NameLocal;

            if (s != null)
            {
                System.Windows.Forms.MessageBox.Show(nativeDocument.Name + " was clicked.  Style: " + s);
            }
        }