Does VSTO C# Shapes.AddPicture ignore passed in anchor reference on first document page in Word 365?

David Lovell 1 Reputation point
2021-11-15T17:28:47.677+00:00

I have a VSTO Add-In that works for Word 2016 but not Word 365. It replaces images by using the Shapes.AddPicture API, then updates various properties of the new shape with the new image before deleting the old shape. I use the Anchor of the old shape to create the new one.

In Word 2016 this works: the Anchor for the new shape is set to the same position as that for the old shape - the start of the second paragraph, say. In Word 365 in the first page it sets the anchor to the start of the first paragraph, and then I have to try to move it to the correct position (using cut and paste being the only reliable way I've found so far, but that leaves an image on the Clipboard when I close the document).

Does anyone know whether there's an issue with Shapes.AddPicture and anchors on the first page of a Word 365 document, or should I be doing something different for Word 365?

Thanks.

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,519 questions
{count} votes