Down load text field to CNC machine

Has anyone tried this successfully? I’d like to edit and manage the machining programs in Notes and then be able to send the text to a CNC machine tool on our network.

I have an experiment set up using the following macro button that I can try once I get the hardware connected…

Sub Click(Source As Button)

'access current document

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim text As String

Set uidoc = workspace.CurrentDocument   

'Body_5 contains the text of the machine program

    text = uidoc.GetSelectedText("Body_5")





'open "com1" for output

fileNumber% = Freefile

Open "COM1" For  Output As fileNumber%

'send data to com1

Print #fileNumber% ,text

'close open items	

Close fileNumber%

'message about completion

Msgbox "Wow, that was fun"

End Sub