示例#1
0
        private void Application_WindowBeforeDoubleClick(Selection Sel, ref bool Cancel)
        {
            InlineShapes SelectedObj = Sel.InlineShapes;

            if (SelectedObj.Count == 0)
            {
                return;
            }
            InlineShape SelectedObjFirst = SelectedObj[1];

            if (!SelectedObjFirst.AlternativeText.Contains("WordxTex_TexContent"))
            {
                return;
            }
            LaTexEdt CodeEditor = new LaTexEdt(false, SelectedObjFirst.AlternativeText, 0, 0);

            CodeEditor.ShowDialog();
        }
示例#2
0
        private void btn_edit_Click(object sender, RibbonControlEventArgs e)
        {
            Microsoft.Office.Interop.Word.Document ThisDoc = Globals.ThisAddIn.Application.ActiveDocument;
            if (ThisDoc == null || ThisDoc.ReadOnly)
            {
                return;
            }
            InlineShapes SelectedObj = ThisDoc.Application.Selection.InlineShapes;

            if (SelectedObj.Count == 0)
            {
                return;
            }
            InlineShape SelectedObjFirst = SelectedObj[1];

            if (!SelectedObjFirst.AlternativeText.Contains("WordxTex_TexContent"))
            {
                return;
            }
            LaTexEdt CodeEditor = new LaTexEdt(false, SelectedObjFirst.AlternativeText, 0, 0);

            CodeEditor.ShowDialog();
        }