none
how to insert textbox in word addins in specefic range using c# RRS feed

  • Question

  • hi everyone,

    I want to insert a textBox control in a word document in specefic location. the location is the position of mouseClick.

    myCode is

         Microsoft.Office.Interop.Word.Shape s;
            
    Document vstoDocument = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
                Word.Selection selection = Globals.ThisAddIn.Application.Selection;
                if (selection != null && selection.Range != null)
                {
                    Word.Range wdFunctionR = Globals.ThisAddIn.Application.Selection.Range;
        s = vstoDocument.Shapes.AddTextbox(Office.MsoTextOrientation.msoTextOrientationHorizontal, 500, 100, 10, 10);
                 

    how can I store the position of the mouse click to insert the textbox in it??

    thanx

    Thursday, September 13, 2012 8:32 AM

Answers