Note with attachment is created using vba but file is corrupt

I created a note with attachment using vba code but after clicking on the attachment inside the ticket the application says that it is corrupt