예제 #1
0
        void displayAddress_Click(object sender,
                                  Microsoft.Office.Tools.Word.ActionEventArgs e)
        {
            int termStart = e.Range.Start;
            int termEnd   = e.Range.End;

            System.Windows.Forms.MessageBox.Show("The recognized text '" + e.Text +
                                                 "' begins at position " + termStart.ToString() +
                                                 " and ends at position " + termEnd.ToString());
        }
예제 #2
0
        void displayAddress_BeforeCaptionShow(object sender,
                                              Microsoft.Office.Tools.Word.ActionEventArgs e)
        {
            Microsoft.Office.Tools.Word.Action clickedAction =
                sender as Microsoft.Office.Tools.Word.Action;

            if (clickedAction != null)
            {
                clickedAction.Caption = "Display the location of " +
                                        e.Text;
            }
        }