Hello,Object-to-object or page-to-page alignment is a standard option. I need a method / VBA code to align the object to the screen or window. Is it possible?I have an idea to use Desktop object but I don't know how.
Greetings!
I dont know if works in X5
[CgsAddInMacro] public void AlignByScreen() { double leftX = 0; double bottomY = 0; corelApp.ActiveWindow.ScreenToDocument(corelApp.ActiveWindow.Left, corelApp.ActiveWindow.Top + corelApp.ActiveWindow.Height, out leftX, out bottomY); corelApp.ActiveShape.BottomY = bottomY; corelApp.ActiveShape.LeftX = leftX; }
Converted ti VBA by ChatGPT,
Dim leftX As DoubleDim bottomY As Double
' Convert screen coordinates to document coordinatesActiveWindow.ScreenToDocument ActiveWindow.Left, ActiveWindow.Top + ActiveWindow.Height, leftX, bottomY
' Set the BottomY and LeftX properties of the active shapeActiveShape.BottomY = bottomYActiveShape.LeftX = leftX
This is interesting for doing things like this
Hello,Thanks for this answer. I'll check later today-Greetings!