Re: Browse for documents (using explorer)

From: Graham Mandeno (Graham.Mandeno_at_nomail.please)
Date: 12/06/04


Date: Tue, 7 Dec 2004 08:56:02 +1300

Hi Niklas

I don't really understand your question. The function will return the full
file specification, including the path *and* the filename and extension.
You will need all of this if you want later to launch the file, or attach it
to an email.

Do you mean you want to store the path and the filename in different fields?
If so, then you can use the InStrRev function to find the position of the
*last* backslash in the file spec, then use Left and Mid to extract the
substrings before and after that position.

-- 
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
"Niklas Östergren" <niklas.ostergren@spray.se> wrote in message 
news:uEkhH042EHA.3236@TK2MSFTNGP15.phx.gbl...
> Hi Graham!
>
> I have tested with the dialoge box Save/Open as you linked me to. It´s 
> what
> I want and I have figure out hiw to store the path but how do I get the
> final filename out of it?
>
> This is a little "over my head" even if I have read about API-calls but
> never used them.
>
> TIA!
> // Niklas
>
>
> "Graham Mandeno" <Graham.Mandeno@nomail.please> skrev i meddelandet
> news:uPMYAv22EHA.1452@TK2MSFTNGP11.phx.gbl...
>> Hi Niklas
>>
>> First, I advise you NOT to try to store the contents of your documents in
>> the database.  This will lead to enormouos database bloat, and will
>> contribute to the likelihood of corruption.
>>
>> Instead, store only the path and filename of the document.
>>
>> To browse for documents, you can use the standard Windows File Open
> dialog.
>> There is some code here to do this:
>> http://www.mvps.org/access/api/api0001.htm
>>
>> -- 
>> Good Luck!
>>
>> Graham Mandeno [Access MVP]
>> Auckland, New Zealand
>>
>> "Niklas Östergren" <niklas.ostergren@spray.se> wrote in message
>> news:ez17oB22EHA.2156@TK2MSFTNGP10.phx.gbl...
>> > God morning!
>> >
>> > I´m about to create a possability for my users to create a msg which
> have
>> > attachment linked to the msg and then linke the msg to all e-mail
> address
>> > that the msg (with attachments) have been sent to. So the user can 
>> > store
>> > every dispatch and se who have recived what and when.
>> >
>> > I know that it should be possible to add documents (word documents,
> Excell
>> > files, pictures etc.) to a table in Access. I have allready created a
> set
>> > of
>> > tables for storing e-mail message (only the text) and 2 related tables
>> > (one
>> > for storing documents [ActiveX-Object] and one for relate between these
>> > documents and the e-mail msg.).
>> >
>> > But how do I do to let the user browse for the files they want to
> attache
>> > to
>> > the e-mail msg?
>> >
>> > I have a form <frmDispatchMsg> (holding the msg) and a subform
>> > <frmsubDispatchMsgDocumentAttachment> (holding the attachments).
>> >
>> > From the subform it´s possible to right-click and select
>> > "Attache-document".
>> > But this isn´t verry user friendly since the user then have to select
>> > "Browse" to get to the place I´d like to open up with one mous-click
> (the
>> > explorer window.
>> >
>> > Is there any KB or any place in internet I can read about how to do
> this?
>> >
>> > More specific I´d like to open up the explorer window in which I select
>> > which file (any type) I´d like to store in my table (tblDocument) in a
>> > ActiveX-field.
>> >
>> > How to then link this document to the DispatchMsg is easy. But how do I
>> > get
>> > the document in to the table?
>> >
>> > Next Q is:
>> > - Since there isn´t any possability (as far as I know of) to open up
>> > either
>> > a combobox or a listbox showing all ActiveX-document stored in
>> > tblDocuemnt.
>> > How do I show, in a form, which document that is allready stored in
>> > tblDocuemnt for the user?
>> >
>> > Finaly:
>> > - Is there a way to retrive, from the explorer when I store the 
>> > document
>> > in
>> > my table <tblDocment> the name of the file so I can show that instead 
>> > of
>> > [Microsoft Word document] or [Microsoft Photo Editor 3.0-foto]. This
> isn´t
>> > either verry userfriendly?
>> >
>> > TIA!
>> > // Niklas
>> >
>> >
>>
>>
>
> 


Relevant Pages


Loading