How it Works

The routine to submit the workbook is called SubmitSheet. The relevant code is described as follows.

Save the current workbook to a temporary file:


    sTempFile = ThisWorkbook.Path & "\~expense.tmp"
    ThisWorkbook.SaveCopyAs sTempFile

Send the current workbook using the MAPISendDocument function:


    lResult = MAPISendDocuments(0, ";", \
        sTempFile, ThisWorkbook.Name, 0)
    If lResult <> SUCCESS_SUCCESS Then
        MsgBox GetMAPIErrorText(lResult), 48
    End If