I'd like to add a shape to the selected canva within existing MS Word document. I can't figure out how to do that. This time macro recorder of MS Word doesn't bring any help.
My unsuccessful attempts:
Code: Select all
oWord.ActiveDocument.Selection.Shapes.AddShape(msoShapeRectangle := 1, 100, 100, 70, 30)
oWord.Selection.Range.Shapes.CanvasItems.AddShape(msoShapeRectangle := 1, 100, 100, 70, 30)
oWord.Selection.ChildShapeRange.AddShape(msoShapeRectangle := 1, 100, 100, 70, 30)
oWord.Selection.CanvasShapes.AddShape(msoShapeRectangle := 1, 100, 100, 70, 30)
oWord.Selection.AddShape(msoShapeRectangle := 1, 100, 100, 70, 30)
...//docs.microsoft.com/en-us/office/vba/api/word.selection.childshaperange
and here:
...//docs.microsoft.com/en-us/office/vba/api/word.canvasshapes.addshape
(Above links are out-of-order because of forum security rules).
but it doesn't solve my issue.
Kind regards, mslonik