My vba macro for aligning a shape to the top right corner of the page in word isn't working


Sub alignGraphicElementToTopRightCornerOfPage()
'
' alignGraphicElementToTopRightCornerOfPage Macro
'
'
    Selection.ShapeRange.Align msoAlignTops, True
    Selection.ShapeRange.Align msoAlignRights, True
End Sub
See the difference between what happens when I use the macro, and what happens when I manually do the multiple commands from the ribbon.

I created the macro using the record feature.

The macro makes the item go off the page which is undesired behaviour, which is not what happened when I recorded the macro.

word shape align macro.jpg

Why isn't it working? I recorded the macro correctly. Is there any vba code I need to change or add to it?


I'm using Word 2007