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: - 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
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 strInputFileName = to me.mail_attachement_path.value with no luck.
I am calling the function from a button where I have also tried:
Me.mail_attachement_path.value = EmailAttach with no luck.
Solved it! - Private Sub Command34_Click()
-
Me.Mail_Attachment_Path = EmailAttach()
-
End Sub
- Function EmailAttach() As String
-
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 (*.*)", "*.*")
-
EmailAttach = ahtCommonFileOpenSave(InitialDir:="C:\", _
-
Filter:=strFilter, FilterIndex:=3, flags:=lngFlags, _
-
DialogTitle:="Email attachment
-
-
-
End Function
-
1 1778
Solved it! - Private Sub Command34_Click()
-
Me.Mail_Attachment_Path = EmailAttach()
-
End Sub
- Function EmailAttach() As String
-
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 (*.*)", "*.*")
-
EmailAttach = ahtCommonFileOpenSave(InitialDir:="C:\", _
-
Filter:=strFilter, FilterIndex:=3, flags:=lngFlags, _
-
DialogTitle:="Email attachment
-
-
-
End Function
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Richard |
last post by:
In an attempt to try out some things with php, I have run into a new snag.
The output file is pure text.
Basically it's a simple photo gallery using <ul> links to show various
thumbnails.
In...
|
by: Frank Xia |
last post by:
How to highlight selected tab text? I only want the tab page text to be
highlighted not the whole content on the page. I can't find a related
property to be set. Need help here. Thanks a lot!
|
by: Roy Gourgi |
last post by:
Hi,
How could I append a text file to another text file. Let's say that I have a
File1 and I want to append File2 at the end of File1, how would I do that?
TIA
Roy
|
by: Tristán White |
last post by:
Hi
I am very new to PHP - actually, this is my second day at it, as I've only
recently started a new job last week. We're a charity.
I have a "No input file selected" problem. A Google search...
|
by: LouArnold |
last post by:
I have a need to replace text in a file with new text. The files may or may
not be text files in the sense that there may not be "lines" and they may not
contain printable characters.
I tried...
|
by: gujarsachin2001 |
last post by:
Hi friends,
I m just stuck with extracting excel file data into text file.
So can any body please help me out.
thx,
Sachin.
|
by: kamill |
last post by:
i need to write content of one text file into another text file.
My code is working ,if i choose both files from same directory where my program reside..BUT,its not working if i select files from...
|
by: gravikiranreddy |
last post by:
In pdf file select particular text and when i click on the button in another page textbox-the text should be Pdf selected text using javascript function in VB.net
|
by: Dinu |
last post by:
hi
i am having a gridview in aspx page and a usercontrol in master page
of that page
now what i want is selected row text to be displayed in usercontrol
i wrote code as follows:
...
|
by: electric_r |
last post by:
Hallo,
I have 2 questions:
with php and mysql :
1) How can I insert a text file into a TEXT field of a table ?
2) How can I insert a microsoft word file into a BLOB field of a
table ?
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |