Examples:
The following VBA example displays the build number of the current CorelDRAW application in a message box.
Sub BuildVersion()
MsgBox "You are using CorelDRAW build " & VersionBuild
End Sub
The following VBA example displays the build number of the current Corel DESIGNER application in a message box.
Sub BuildVersion()
MsgBox "You are using Corel DESIGNER build " & VersionBuild
End Sub
The following VBA example detects earlier versions of CorelDRAW. Version properties were introduced in CorelDRAW 9 Office Edition.
Sub Main()
Dim v&, b&
GetDrawVersion v, b
MsgBox v & "." & b
End Sub Sub GetDrawVersion(v As Long, b As Long)
On Error Resume Next
Err.Clear
v = CorelDRAW.Application.VersionMajor
If Err.Number <> 0 Then
v = 9
b = 439
Else
b = CorelDRAW.Application.VersionBuild
End If
On Error GoTo 0
MsgBox "You are using CorelDRAW " & v & "." & b
End Sub
The following VBA example detects earlier versions of Corel DESIGNER.
Sub Main()
Dim v&, b&
GetDesignerVersion v, b
MsgBox v & "." & b
End Sub Sub GetDesignerVersion(v As Long, b As Long)
On Error Resume Next
Err.Clear
v = CorelDESIGNER.Application.VersionMajor
If Err.Number <> 0 Then
v = 9
b = 439
Else
b = CorelDESIGNER.Application.VersionBuild
End If
On Error GoTo 0
MsgBox "You are using Corel DESIGNER " & v & "." & b
End Sub