How to fix shape position in word document RRS feed

  • Question

  • Hello,

    I developped a vb program that copy some range from Excel and paste it in word document as OLE Object. 

    Then, the program change postion of this shape. This is my code

     WordApp.Selection.PasteSpecial( _
         DataType:=0) ' Paste as Objet OLE.
         with myDoc.Shapes(nbrshape)
          ' .RelativeHorizontalPosition =  WordApp.wdRelativeHorizontalPosition.wdRelativeHorizontalPositionPage
          ' .RelativeVerticalPosition = WordApp.wdRelativeVerticalPosition.wdRelativeVerticalPositionPage
          .height = 510
          .width = 530
          .Top = 110      
          .Left = -30  
         End With

    But I have a problem that the shape is move with the text, if I add text or empty spaces above the shape. So, I used the "RelativeVerticalPosition" but, it makes no difference.

    So, How to enable shape move with the text?

    Monday, October 19, 2015 2:06 PM


All replies