Application.FindFile

G

Girija

Hi

I am using the following statement to capture the file name selected by the
user

TextBox1.Text = Application.FindFile

But Textbox1.Text doesn't contain the selected filename. What should I do to
store the filename selected by the user?

Thanks
 
R

Rod Gill

Hi,

That method simply opens the file open dialog to let the user select a file.
Project versions haven't supported the Office file system objects, so the
simplest way to get a file path from a user is to use a windows API. See
http://www.mvps.org/access/api/index.html for code that works equally well
in Project as it does in Access.

--

Rod Gill
Project MVP

NEW!! Project VBA Book, for details visit: http://www.projectvbabook.com
 
G

Girija

Hi Rod,

I tried that API, it opens the windows browser and not the Microsoft Project
server File -> Open . I need to know how to do Microsoft Project server File
-> Open.

Thanks

Girija
 
G

Girija

Hi Rod,

So in this case suppose I use windows API. Is there any default folder where
the published projects are saved, I mean which server and which folder. Maybe
if can explain me with an example please.

Thanks
Girija
 
R

Rod Gill

If you are using Project server or a database to open projects from then the
windows API won't find SQL Server for you, but it will find a .mdb file.

The idea is that you let the user browse to the file, you record the path
then open the project using the Application.FileOpen method to open the
file. If the file is already open, then the path is in: activeproject.Path

--

Rod Gill
Project MVP

NEW!! Project VBA Book, for details visit: http://www.projectvbabook.com
 
G

Girija

Hi Gill,

I was looking into the tables and found something similar to what you
mentioned. So you mean to say if a project "TEST" is published. As per the
application it is TEST.published. But you mean to say its stored as TEST.mdb?
Could you please clarify this ? so how are templates stored. which is the
default path where all these files are stored?

So I have to use the same windows browser API for the user to browse the
file. Then capture the path and open the project?

Thanks a lot, things are getting clearer now.

Thanks a tonne

Girija
 
G

Girija

Hi Gill,

This is in continuation of my previous mail. I retrieved the data from
MSP_WEB_PROJECTS table from SQL server which has data related to the MSP
files. Now there are 2 fields WPATH and WLOACAL_PATH. both by default store
in path <>\. Now my question is <>\ indicates in c:\. But when I went to that
directory there is actually no file TEST.published. When I used the
activeproject.Path it retured <>\ , by which I am lost now what it means?

Could you help me please.

Thanks

Girija
 
J

John

Rod Gill said:
If you are using Project server or a database to open projects from then the
windows API won't find SQL Server for you, but it will find a .mdb file.

The idea is that you let the user browse to the file, you record the path
then open the project using the Application.FileOpen method to open the
file. If the file is already open, then the path is in: activeproject.Path
Rod,
I found another API on the website you cited called, "Enumerating local
and Network Drives". Would that be useful in this case? I found it
several weeks back when I was dealing with UNC drives for a client's
macro but I never tried it and was a little leery about using it in
something for a client.

John
 
G

Girija

Hi John,

Thanks to Rod and you. John any idea as in which format and where are the
published projects and templates are stored? As Rod mentioned find .mdb
file, I have this question also I searched for .mdb but couldnt find any. so
was wondering where they are stored? when I used activeproject.Path, its
returning "<>"!! Wonder what it means now? I am waiting for answers to my
above questions?

Thanks

Girija
 
J

John

Girija said:
Hi John,

Thanks to Rod and you. John any idea as in which format and where are the
published projects and templates are stored? As Rod mentioned find .mdb
file, I have this question also I searched for .mdb but couldnt find any. so
was wondering where they are stored? when I used activeproject.Path, its
returning "<>"!! Wonder what it means now? I am waiting for answers to my
above questions?

Thanks

Girija
Girija,
As I mentioned in a previous response, I don't do Project Server so I
can't help you with the location of published projects and templates.
Rod should be able to provide further assistance on that issue.

John
Project MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top