Customization to Automaticly attach a document

We are attaching original documents such as Sales Orders to
Vantage/Epicor Tables. Company configuration is set to allow Default
documents with the File System Document Method, which means to
attachment is copied to a default network location. We installed
scanners to scan to a folder on clients to .pdf files. We added a
custom button on the Sales Order screen to rename the scanned file to
Order-nnnnnn.pdf, then the user drags the file into the tree to save the
attachment. We also added an after field change event handler for the
OrderHedAttach table to delete the .pdf file from the client after the
attach is successfully completed.

That this working great and I can share my customization of anyone wants

I would like to enhance my custom button to not only rename the file,
but to also automatically attach the document like it is being dragged
on to the tree. I assume I need to call the XFileRefAdapter, but I
don't know how. I'm looking for sample code (VB preferred) or guidance
to complete this project.

My users are scanning original documents and attaching to
Vantage/Epicor Table headers. We are no longer file original paper for
Sales Orders, warehouse pick lists (customer shipment entry), vendor
packing slips (Receipt entry) and AP invoices (we still file some paper
for non-inventory invoices). We use windows security to control who can
open attachments. We have been doing this since April 1st and so far
all users are very happy.

Thank you all in advance.
- Dan
Independent Components Corp.

[Non-text portions of this message have been removed]