I have created this simple macro on X6 that will move everything in the page to the right side outside the page. I have no knowledge coding but I need to change it in order to run through all the pages selecting and moving everything in each page to the right side outside the page and stacking evrything vertically. Page size will always be 24 x 18 inches.
I will really appreciate it if I could get some help with this. I have to do this almost everyday for laser engraving files with many pages. It will be a real time saver if I could automate this task.
Thank you in advance and this is the macro created but working only in one page.
Sub Macro1() ' Recorded 1/20/2023 ActivePage.Shapes.All.CreateSelection ActiveSelection.Move 26, 0#End Sub
You could try this:
Sub move_things() Dim pThis As Page For Each pThis In ActiveDocument.Pages pThis.Shapes.All.Move 26, 0 Next pThis End Sub
or perhaps this:
Sub move_things() Dim pThis As Page For Each pThis In ActiveDocument.Pages pThis.Activate ActivePage.Shapes.All.Move 26, 0 Next pThis End Sub
Thank you soooo much. The first one works!, only thing is that it is stacking everything on top of each other instead of vertically, but I guess I can just space them after, no big deal. Also, other than the first page, I only see the obects moved if I change pages manually.
I trully appreciate your quick answer.
JM1977 said: Also, other than the first page, I only see the obects moved if I change pages manually.
Ah, OK, I was not considering that you were also having CorelDRAW automagically move shapes to the Desktop layer when they are moved outside the page boundary.
You could try this one, which "stacks" the moved content vertically, and also walks through the document, activating each page, which should trigger the move-to-Desktop:
Sub move_things() Dim pThis As Page Dim srThis As ShapeRange Dim dblLastBottomY As Double Const dblVertSpacing As Double = 1 For Each pThis In ActiveDocument.Pages Set srThis = pThis.Shapes.All srThis.Move 26, 0 If pThis.Index > 1 Then srThis.TopY = dblLastBottomY - dblVertSpacing End If dblLastBottomY = srThis.BottomY Next pThis For Each pThis In ActiveDocument.Pages pThis.Activate Next pThis ActiveDocument.Pages.First.Activate End Sub
Wow that is impressive, it works perfectly!, evenly spaced 1 inch apart. I can not be more grateful. I have been needing this for years. Thanks you so much.
Do you know a site or a set of tutorials that I could use to learn some CorelScript, it will be very helpful for me from now on to learn some basic coding for coreldraw.
Thank you again for your quick response
JM1977 said:Do you know a site or a set of tutorials that I could use to learn some CorelScript, it will be very helpful for me from now on to learn some basic coding for coreldraw.
John - who went by the handle Sub GDG_John( ) on the CorelDRAW Community forum - made a series of tutorial videos (in Flash, maybe?) that were available on the CorelDRAW Community site. At some point in time, some of them ceased to be available there; I don't know what the current situation is.I wish that I could point you to a comprehensive collection of them, because they really were something where someone could, if they wished, "start from scratch" and learn a lot about VBA in CorelDRAW.I think that John put at least some of those up on YouTube. Try searching for GDG Macros Tutorials.You might also look at some of the resources in the Developer Area of the Community site.
Great. I found the GDGmacros chanel in Youtube. Many thanks again!
Jose
Hey, best of luck with that!
If you have questions, then don't be shy about asking on the forums in the Developer Area.
Shameless plug: You can find some ready-to-use macros on my blog here on the Community site: Eskimo's Macros and More.
For sure!. You have a great collection of macros, do they work in the old corel x6?
Ah, I forgot that we were in the X6 forum. No joy for X6; sorry!
The oldest version I have available to me is X7, so that's what I use for creating those macros.