How to get current insert position in word? RRS feed

  • Question

  • Hi all.

    My project is an add-in for office.

    Use ActiveDocument.Shapes.AddOLEObject() method to insert my custon ActiveX control.

    Shape AddOLEObject( ref Object ClassType, ref Object FileName, ref Object LinkToFile, ref Object DisplayAsIcon, ref Object IconFileName, ref Object IconIndex, ref Object IconLabel, ref Object Left, ref Object Top, ref Object Width, ref Object Height, ref Object Anchor )

    // I cannot use InlineShapes.AddOLEObject Method for some reason

    how can I get input focus positon for parameters left and top to insert my object?

    Thanks in advance.

    Wednesday, October 15, 2014 10:18 AM


  • If you are looking for the current insert position that can be obtained by reading the start range property value.

    Debug.Print Selection.Range.Start

    Hope this helps

    Kind Regards, Rich ...

    Wednesday, October 15, 2014 12:28 PM