Message box prompt for file name

S

Sailormike

I need to create a Word macro that will save a document to the same place on
the network but pause for the user to name the file. Once the name is entered
then save the file, always in the same place, just a different name.

I'm an Access guy who knows a little VBA. I am building an Access app but i
need Word for this one small function.

I just don't trust users to navagate to the right place on the network once
they hit file, saveas - and Access looks to this one place for hyperlinks to
documents so if they are not there the Access user gets an error message.
 
J

Jezebel

You can use the built-in FileSave dialog (read help on the Dialogs
collection); or you can create a UserForm with a CommonDialog control on it.
You needn't display the form to display use the commondialog. The advantage
of the CommonDialog is that you can specify the folder and set the flags to
prevent the user choosing any other folder.
 
J

Jean-Guy Marcil

Sailormike was telling us:
Sailormike nous racontait que :
I need to create a Word macro that will save a document to the same
place on the network but pause for the user to name the file. Once
the name is entered then save the file, always in the same place,
just a different name.

I'm an Access guy who knows a little VBA. I am building an Access app
but i need Word for this one small function.

I just don't trust users to navagate to the right place on the
network once they hit file, saveas - and Access looks to this one
place for hyperlinks to documents so if they are not there the Access
user gets an error message.

The easiest is to pop up an InputBox (or create your own small userform) and
ask the user to type a File name. You might want to check for illegal
characters.

Then using that user name, save the file yourself using the path you want.
You can do all that from Access.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jezebel

Easier to use the CommonDialog: it validates the filename for you, and also
deals with issues such as the file existing already.
 
S

Sailormike

I'm sorry guys u r just way ahead of me.

I have no idea how to call a function in Word other than with a macro and
now that i look at the WordBasic code I don't think u can call a built-in
fuction with a marco. Functions start with a sub statement and macros don't.

Access I know a little, in Word i know how to make documents and spell check.
 
J

Jezebel

Of course you can call a function from macro code. Just look at the examples
in Help.
 
S

Sailormike

Sorry guys none of this helps. If I search on CommonDialog i get nothing
either in word or on-line @Microsoft. I did find a dialoge collection but
using it is WAY above my pay grade.

Thank u for the effort but i will just have to try to teach these folks how
to navigate on the network.
 
J

Jezebel

persevere -- it's not hard.

Create a UserForm. The CommonDialog is one of the controls on the Toolbox.
If it's not showing, right-click, select 'Additional Controls' and select
'Microsoft CommonDialog' from the list. Do a Google for documentation and
sample code.
 

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