The LinkFolderToNewMessage function takes a list of entry identifiers leading to the linked folder, formats the folder link, and places it in an attachment to pmsg, along with rendering and positioning information.
STDAPI LinkFolderToNewMessage( LPMESSAGE pmsg, LPENTRYLIST pel, LPSTR szFileName, LPSTR szFolder, HICON hicon, ULONG ulPos );