OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 09-10-2008, 10:46
bprice's Avatar
bprice bprice is offline
Join Date: Oct 2006
Location: Edmundston, New Brunswick, Canada
Posts: 89
Default Position Question

How come if I do this...

ActiveSelection.GetPositionEx cdrTopLeft, x, y
I always get a result back on "Y" that is 3" to much?

If I put the top left corner of an object at 0,0 position on the page, I get X = 0 and Y = 3

This worked fine the other day and gave me the proper results... 0,0... and I don't know what changed... but now I always get 3" to much...

Reply With Quote
Old 11-10-2008, 21:39
shelbym's Avatar
shelbym shelbym is offline
Senior Member
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,788
Blog Entries: 12
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default GetPositionEx

Bad news is, it is broken. Good news it the number is consistent so you can write a fix. If you don't was to subject every time just right a Private Sub that does this for you. I have given you an example and added the feature of rounding the values that are returned.

In CorelDRAW X4, SR1 the value is off by 1.25, so adjuct this value as needed for your version

Hope you find it helpful.
Sub TestingGetPositionEx()
    Dim x1 As Double, y1 As Double
    GetPositionExFix ActiveShape, cdrBottomLeft, x1, y1, 3
    MsgBox x1 & ", " & y1
End Sub

Private Sub GetPositionExFix(s As Shape, cdrRefPoint As cdrReferencePoint, x1 As Double, y1 As Double, intPrecision As Integer)
    s.GetPositionEx cdrRefPoint, x1, y1
    x1 = Round(x1, intPrecision)
    y1 = Round(y1 + 1.25, intPrecision) 'Adjust this number as needed
End Sub
Best of luck,

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
Position inch to mm GoodLook CorelDRAW/Corel DESIGNER VBA 2 11-11-2008 01:47
Text position CWCN CorelDRAW/Corel DESIGNER VBA 2 22-09-2008 23:40
Pasting in position longline Corel Photo-Paint VBA 2 27-05-2008 19:17
Get the position of the mouse gbottesi CorelDRAW/Corel DESIGNER VBA 3 17-07-2006 21:55
Position inch to mm GoodLook Macros/Add-ons 1 31-12-1969 19:33

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

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