OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
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 curiosity...is 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

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Guidelines macro kenpoist CorelDRAW/Corel DESIGNER VBA 5 05-01-2011 13:12
How do i print the guidelines? cristov General 3 26-02-2006 22:49
How to duplicate an object along common center Alex FAQ 2 03-05-2005 14:46
Snap to guidelines ddonnahoe CorelDRAW/Corel DESIGNER VBA 2 22-11-2004 12:21
Getting the center X on a text shape Rick Randall CorelDRAW/Corel DESIGNER VBA 4 03-08-2004 18:27

All times are GMT -5. The time now is 18:22.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com