The button attach file control adds a button with that will add a file to the history of the attached contact. When clicked on a form the button will open a window to select the file to attach and then attach that file.
The default code in the control is
'--------------------------------------------------
' Attach a file
'--------------------------------------------------
HostApplication.UIHistoryManager.AttachFile()
To change the default code, click the ellipses (...) button in the properties panel, change the code and click save.