![]() |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Is there a way to get an array with names of the constants that are in a given corel VBA enumeration.
For example for cdrUnit to recieve array with string values (names of the constants, not their values) like: Code:
cdrTenthMicron, cdrInch, cdrFoot, cdrMillimeter, cdrCentimeter, cdrPixel, cdrMile, cdrMeter, cdrKilometer, cdrDidots, cdrAgate, cdrYard, cdrPica, cdrCicero, cdrPoint, cdrUnitQ, cdrUnitH Like it is in combobox near to the width spinbuton in Layout | Page Setup | Document | Page | Size Well if there is no standard way I would write them by hand, in that case I just need confirmation that there is no way :roll: Question is for CorelDraw 12 VBA ____ Also what kind of measures are cdrTenthMicron and cdrAgate? |
#2
|
||||
|
||||
![]() Quote:
Quote:
1 agate = 1/14 inches. |
#3
|
|||
|
|||
![]()
One slightly related to this issue problem.
How to retrieve the current setting made of user for measurement units on page (See Layout | Page Setup | Document | Page | Size or Property Bar when there is no selection)? I tried ActiveDocument.Unit and Application.Unit also but they always give me cdrInch, no matter what I have selected in the combo. ![]() The ugly thing is that I am actually with Bulgarian regional settings (metric system) so I don't have idea where this "inch" comes from. |
#4
|
||||
|
||||
![]()
The Unit property of both Document and Application objects are VBA-only properties and used only to specify the units of various VBA methods and their parameters (such as Layer.CreateRectangle). What you want to get is the ruler units. You can get to them using Document.Rulers.HUnits and Document.Rulers.VUnits properties.
Hope this helps. |
#5
|
|||
|
|||
![]()
Well it seems that this setting is actually the measurement unit for the horizontal ruler.
Thank you. |
#6
|
|||
|
|||
![]()
Corel is for sure funny here!
I can't find where the inches come from either... To make it even more funny the cdrUnit numbers do not correspond to the XRulerUnits stored in the registry under HKEY_CURRENT_USER\Software\Corel\CorelDRAW\13.0\CorelDRAW\Application Preferences\Ruler and Grid Settings So anyhow Corel Units are easily the most mind boggling I've ever dealt with.. Code:
Dim Draw As CorelDRAW.Application Set Draw = New CorelDRAW.Application 'Draw.Unit = cdrMillimeter Debug.Print Draw.Unit Debug.Print Draw.ActiveDocument.Unit Debug.Print Draw.ActiveDocument.Rulers.HUnits 'Get user's unit pref from registry Debug.Print CorelScriptTools.RegistryQuery(1, "Software\Corel\CorelDRAW\13.0\CorelDRAW\Application Preferences\Ruler and Grid Settings", "XRulerUnits") Best, m31uk3 Last edited by m31uk3; 09-02-2009 at 20:17. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
List names of files located in a folder | RVogel | CorelDRAW/Corel DESIGNER VBA | 1 | 31-03-2005 16:14 |