I received a spreadsheet where all the comments had a God awful high-contract day glow color format. No problem. Wrote a quick macro to reset them to the default values. But I noticed some strange behavior that I can't explain or fix. When you set the msoShapeType of a comment, it changes the anchor point for the line pointing from the comment box to the cell. Instead of being anchored at the top left, the line is now anchored in the center of the comment box.
The code below will illustrate this behavior.
I can not find any property that has changed when the msoShapeType is set. I can not find any property to change the anchor point of this line.
Any ideas what drives this behavior and how to change it?
The code below will illustrate this behavior.
Code:
Sub CommentLineBehavior()
' Create a comment in a new blank worksheet.
' Edit comment and move it around the spreadsheet with mouse.
' The anchor point for the pointer line is at the top left corner.
' Run this macro
' Now edit and move comment and the anchor point is in the center of the comment box.
Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
With cmt
' print autoshapetype to immediate window...it will be 1 (msoShapeRectangle)
Debug.Print .Shape.AutoShapeType
' Set the autoshapetype to msoShapeRectangle
.Shape.AutoShapeType = msoShapeRectangle
End With
Next cmt
End Sub
I can not find any property that has changed when the msoShapeType is set. I can not find any property to change the anchor point of this line.
Any ideas what drives this behavior and how to change it?