Home/ Reference/ Connection & Init

app.Version

Returns the version as a string. Use it to confirm which version you actually connected to.

Signature

app.Version

Notes

Returns the version as a string. Use it to confirm which version you actually connected to.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
ver = str(app.Version)          # something like "21.3.0.755"
print("Full version: ", ver)

major = int(ver.split(".")[0])  # first segment = major version
if major >= 21:
    print("supports every API in this reference")
else:
    print("older build, some APIs may be missing")

It returns a string, not a number

app.Version is an application-level property returning a version string, shaped like major.minor.build. The format is not consistent across releases — some carry four segments, some include a parenthesised note. So the first rule is: do not treat it as a number, and do not compare it to the digits in a ProgID.

The .21 in a ProgID is the COM registration major version. app.Version is what the application reports about itself. Same release, different format — a string comparison will eventually surprise you.

Where it actually earns its keep: proving what you connected to

When several versions coexist, the biggest unknown is "which CorelDRAW did I land on". Dispatch does not guarantee it is the one you assumed, and CurVer may have been rewritten by another version. app.Version is the only direct evidence.

So the practical use is not branching logic, it is logging:

Python
import logging
import win32com.client

log = logging.getLogger(__name__)

app = win32com.client.Dispatch("CorelDRAW.Application")
log.info("connected to CorelDRAW %s", app.Version)

That one line saves half an hour the day something breaks. Most "this code works on my machine" reports are version differences.

Branching on version without breaking

Interface support does differ between releases: properties get added, method signatures change. When you need to branch, parse the major number and compare — and keep a path for unknown versions:

Python
def major_of(ver_str):
    # "24.0.0.0" -> 24; return None on unexpected formats instead of raising
    try:
        return int(str(ver_str).strip().split(".")[0])
    except (ValueError, AttributeError):
        return None

maj = major_of(app.Version)
if maj is None:
    print("unparsable version string:", app.Version)
elif maj >= 24:
    pass            # newer path
else:
    pass            # older path

Treat "failed to parse" as a normal branch, not an exception. Version strings change format; code that parses them rigidly breaks on some future release.

Do not use it to test whether CorelDRAW is installed

Reading app.Version requires a working app object already in hand — if nothing is installed or connected, you never reach this line. To test installation, read registry CurVer; to test whether it is running, use the result of GetActiveObject. Three separate questions: installed, running, which version.

Why version-to-year tables keep failing

The tables circulating online (X4=14, X5=15 … 2019=21, 2020=22, 2021=23, 2022=24) are broadly right for the early releases. Corel changed the numbering scheme later, and from 2023 onward those tables are often off by one or more.

The reliable route is to read the ProgID currently registered — it always points at something that actually exists. If you need a mapping, maintain your own table and add a line after each upgrade rather than committing it to memory.

Two details

About this section: Connection & Init

Connection & Init — connecting to CorelDRAW over COM.

Other entries in this section