API Documentation > CorelDRAW > 2025-v26 > Window > IVGWindow
Window.ScreenToDocument method
Converts screen coordinates into document coordinates
Syntax:
Sub ScreenToDocument(ByVal XScreen As Long, ByVal YScreen As Long, ByRef XDoc As Double, ByRef YDoc As Double)
Parameters:
Name Type Description
XScreen
Long
YScreen
Long
XDoc
Double
YDoc
Double
Remarks:
The ScreenToDocument property converts screen coordinates to document coordinates.
Examples:
The following VBA example converts the specified screen coordinates to document coordinates.
Sub Test()
Dim x As Double
Dim y As Double
ActiveWindow.ScreenToDocument 515, 404, x, y
MsgBox "The screen coordinates (515,404) converted to document " & _
  "coordinates is (" & x & "," & y & ")." 
End Sub