|SAM automatically sets the sending account, or sender address, and folder for sent items based on several criteria.
This sample creates a serial number and stores it in a simple text file. Please note, the directory must already exist while the file will automatically be created if necessary.
Public Function GetNextID() As Long
Dim lCurrID As Long
Dim File As String
File = "C:Sample.txt"
lCurrID = Val(ReadFile(File))
lCurrID = lCurrID + 1
WriteFile File, CStr(lCurrID), False
GetNextID = lCurrID