Hi all,
I am using some cutdown code which I have changed around to allow me to select a file to be attached to an email within my database. The code is as follows:
However, I am utterly useless at working with functions. How do I get the filename/path selected to be input into a textbox that I specify.
I have tried changing strInputFileNam e = to me.mail_attache ment_path.value with no luck.
I am calling the function from a button where I have also tried:
Me.mail_attache ment_path.value = EmailAttach with no luck.
I am using some cutdown code which I have changed around to allow me to select a file to be attached to an email within my database. The code is as follows:
Code:
Function EmailAttach()
Dim strFilter As String
Dim lngFlags As Long
Dim strInputFileName As String
strFilter = ahtAddFilterItem(strFilter, "Access Files (*.mda, *.mdb)", _
"*.MDA;*.MDB")
strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF")
strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
strFilter = ahtAddFilterItem(strFilter, "PDF Files (*.pdf)", "*.PDF")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
strInputFileName = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, flags:=lngFlags, _
DialogTitle:="Select attachment!
End Function
I have tried changing strInputFileNam e = to me.mail_attache ment_path.value with no luck.
I am calling the function from a button where I have also tried:
Me.mail_attache ment_path.value = EmailAttach with no luck.
Comment