Coreldraw 2018 Convert shape to nodes

Guys

I found the following code at oberonplace.com but it wont let me ask questions so i though I would try Here

Sub DumpCurveInfo()
    Dim s As Shape
    Dim sp As SubPath
    Dim seg As Segment
    
    Set s = ActiveShape
    If s Is Nothing Then
        MsgBox "Nothing selected", vbCritical
        Exit Sub
    End If
    
    If s.Type <> cdrCurveShape Then
        MsgBox "Please select a curve", vbCritical
        Exit Sub
    End If
    
    Open "C:\CurveInfo.txt" For Output As #1
    Print #1, "Sub ReCreateCurve()"
    Print #1, "    Dim s As Shape"
    Print #1, "    Dim crv As Curve"
    Print #1, "    Dim sp As SubPath"
    Print #1, "    Set crv = CreateCurve(ActiveDocument)"
    For Each sp In s.Curve.Subpaths
        Print #1,
        Print #1, "    Set sp = crv.CreateSubPath(" & GetNodePos(sp.Nodes(1)) & ")"
        For Each seg In sp.Segments
            If seg.Type = cdrLineSegment Then
                Print #1, "    sp.AppendLineSegment " & GetNodePos(seg.EndNode)
            Else
                Print #1, "    sp.AppendCurveSegment2 " & GetNodePos(seg.EndNode) & ", ";
                Print #1, CSng(seg.StartingControlPointX) & ", " & CSng(seg.StartingControlPointY) & ", ";
                Print #1, CSng(seg.EndingControlPointX) & ", " & CSng(seg.EndingControlPointY)
            End If
        Next seg
        
        If sp.Closed Then
            Print #1, "    sp.Closed = True"
        End If
    Next sp
    Print #1,
    Print #1, "    Set s = ActiveLayer.CreateCurve(crv)"
    Print #1,
    Print #1, "End Sub"
    Close #1
    End Sub

    Private Function GetNodePos(ByVal n As Node) As String
    GetNodePos = CSng(n.PositionX) & ", " & CSng(n.PositionY)
    End Function



It Is supposed to take the selected shape and dump all the node coordinates to a text file 

so you can recreate it in VBA

this is exactly what I am try to do but haven't got a clue where to start

the code says its for coreldraw 11 but in 2018 I get an error when calling the function
"Private Function GetNodePos(ByVal n As Node) As String"
the error states that "Compile Error Syntax error"
Any ideas how I try and get this working this could potentially save me weeks of
converting manually

Any help appreciated

Mark