Hello,
I have fairly complex code that we use to highlight changes in publications. Basically, it adds vertical lines in the left margin based on a currently selected range of text. A bit like the "Track Changes" line, but as shapes.
I have been using this code since Office 1997 without any problems, that is, until Office 2013...
As I said, the code is complex because there are so many factors to be considered... Is the range in a header/footer? Is there a table? What are the "Space Before" paragraph settings? Is HTML spacing on? How wide is the left margin? etc.
However, it seem the problem is this line of code:
Set myShape = ActiveDocument.Shapes.AddLine(1, 1, 1, 10, rngCurrent.Paragraphs(1).Range)Word 2013 totally ignores the stuff in brackets. It used to be that the coordinates "1,1,1,10" were relative to "rngCurrent.Paragraphs(1).Range". No longer. Word 2013 ignores the Anchor parameter and uses the coordinates as if they were relative to the page and then proceeds to place the anchor next to the first paragraph that is not in a table on the said page.
How do I get it to anchor "myShape" to "rngCurrent.Paragraphs(1).Range"?
Thank you for any assistance.