View Single Post
Old 15-01-2011, 10:27
PAnderson PAnderson is offline
Join Date: Nov 2003
Posts: 47
Default Document Center Guidelines

I recorded a quick little macro to place guidelines at the document center so I could assign it a single keystroke. Out of there a way I can condense this code? It works fine and fast, but seems like it could be shorter for such an easy task!

Sub DocCenterGuides()
    Dim s1 As Shape
    Set s1 = ActiveDocument.MasterPage.GuidesLayer.CreateGuideAngle(7.5, 1#, 0#)
    s1.Outline.SetProperties Color:=CreateRGBColor(0, 0, 255)
    Dim s2 As Shape
    Set s2 = ActiveDocument.MasterPage.GuidesLayer.CreateGuideAngle(1#, 7.5, 90#)
    s2.Outline.SetProperties Color:=CreateRGBColor(0, 0, 255)
    ActiveDocument.CreateShapeRangeFromArray(s1, s2).AlignToPageCenter cdrAlignLeft + cdrAlignRight + cdrAlignTop + cdrAlignBottom, cdrTextAlignBoundingBox
    ActiveDocument.CreateShapeRangeFromArray(s1, s2).Lock
End Sub

Reply With Quote