OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 11-11-2014, 18:07
knowbodynow knowbodynow is offline
Senior Member
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 431
Default Align To Edge of Page?

What's the code to mimic the Align and Distribute dialogue set to "Edge Of Page" "Top" "Left"? I thought it might be this:

ActiveSelection.Shapes.all.AlignRangeToPage cdrAlignTop + cdrAlignLeft
But this does not move the objects to the top-left corner like the dialogue but further above the page and off to the left a little. I wonder if the document is corrupt in some way as the code does work as expected with a new document. Or perhaps it is because the document was created in x4 and I'm using X6. Has anyone else had trouble with align code not working as expected? Thanks.
Reply With Quote
Old 17-11-2014, 10:07
Joe Joe is offline
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe

I have noticed this being the case with other commands as well. I had a macro that had two parts - one to generate a new document with specific settings and another that would populate the document with objects based on some data.

In one of the two the 0 coordinates of the page would seemingly be shifted.

In the end what helped was using specific variables, such as ActivePage.LEftX

So in your case you could do something like ActiveSelection.TopY = ActivePage.Topy and ActiveSelection.LeftX = ActivePage.LeftX

Less elegant, but more consistently successful.
Reply With Quote
Old 17-11-2014, 20:43
knowbodynow knowbodynow is offline
Senior Member
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 431

Thanks, Joe, that's good to know.
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
detect page edge when inserting text gorgo CorelDRAW/Corel DESIGNER VBA 2 06-05-2012 06:08
Align Outside GMS kenpoist CorelDRAW/Corel DESIGNER VBA 3 22-12-2010 09:05
How to delete an edge? (eg of a triangle) hotdog10 General 5 02-06-2009 15:20
better align object cmjmmrp CorelDRAW/Corel DESIGNER VBA 5 29-05-2009 02:18
Exports: color not solid to edge in images kmabee General 3 22-11-2005 09:00

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

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