CorelDRAW Community
CorelDRAW Community
  • Site
  • User
  • Site
  • Search
  • User
Wikis
Wikis
How-to and Tips&Tricks ALIGN CENTER
  • Wikis
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • DUPLICATE
  • The Clone Tool
  • Corel DRAW: Halftone
  • +Corel PHOTO-PAINT
  • Corel PHOTO-PAINT for Adobe PhotoShop users
  • +CorelDRAW
  • CorelDRAW for Adobe Illustrator users
  • +CorelDRAW.com
  • Designer's Guide to Color Management
  • Exporting ai files from CDX6 to Adobe InDesign CS6 - not working!
  • GDG Macros VBA Lessons
  • +Hidden Gems, Keyboard Tricks in CorelDRAW Graphics Suite
  • How and where save globalmacros.gms
  • +How to show Thumbnail Preview
  • +Making flag in CD/PP by Jesus Cota
  • MANUAL FLATTENING
  • Mesh fill tool structure on circular shapes
  • Selection Groups
  • Soft Bevel Macro for CorelDRAW
  • Thumbnails Everywhere
  • Troubleshooting - Computer says No
  • +VBA
  • +Water Effect by Jesus Cota
  • ALIGN CENTER
  • COMMAND BUTTON EXAMPLES
  • +SIM Model
  • +USING PHOTOSHOP AS A BITMAP EDITOR FOR COREL DRAW
  • VSTA and working VSTA examples

ALIGN CENTER

Centering one object relative to another is a common practical task. 
There is nothing complicated about this operation.
If it is done often, the time we spend on it is great.
This necessitates finding ways to automate it, and VBA provides countless such ways.
I will introduce you to one of them that I use to make the job easier.
There are certainly many other similar options.
Certainly some of them are better. Any ideas on the subject would be gratefully received.

Sub BhBp_Center_Objects()
Dim s1 As Shape
Dim s2 As Shape
Set s1 = ActiveSelectionRange.Shapes(1)
Set s2 = ActiveSelectionRange.Shapes(2)
s2.CenterX = s1.CenterX
s2.CenterY = s1.CenterY

'mcenterx = ActiveShape.CenterX
'mcentery = ActiveShape.CenterY

End Sub

  • Share
  • History
  • More
  • Cancel
Related
Recommended

© Corel Corporation. All rights reserved. The content herein is in the form of a personal web log ("Blog") or forum posting. As such, the views expressed in this site are those of the participants and do not necessarily reflect the views of Corel Corporation, or its affiliates and their respective officers, directors, employees and agents. Terms of Use / Privacy​ ​/ ​Cookies / Terms and Conditions / User Guidelines.