input box questions

J

john.e.palmer

I would like to use a input box to present a list of directories,
select a letter, and have Word go to that directory and wait for me to
select a file and then close. I have several related questions:

(1) Should I change the directory with a default filepath statement;
e.g. Options.DefaultFilePath(Path:=wdDocumentsPath) = "Storage:A
Transfer Folder:John:", or is there a way to do this without changing
the default file path?
(2) What is the command to open the directory and wait?
(3) Right now the input box accepts a letter and when I hit return, it
executes the appropriate case. Is there a way to have the macro
execute without hitting the return?

Thanks.
 
J

John McGhie

Hi John:

You want a "Form Field" not an Input Box.

A Form Field enables you to specify code to run on Exit from the field,
which is what you want here.

You do not have to change the default file path. And there is no real point
in doing so, because Mac Word tends to ignore the Default File Path after
the first document in a session.

Far better to define a variable and set it to the path you want to use.

Note that setting the Default File Path in Word only controls where Word
will first look for a document on File>Open. In Mac Word, it is not a
reliable predictor of where the document will be saved.

If you want to play around with files, get used to explicitly setting your
file paths on both open and save, or expect a life of misery :)

Cheers


I would like to use a input box to present a list of directories,
select a letter, and have Word go to that directory and wait for me to
select a file and then close. I have several related questions:

(1) Should I change the directory with a default filepath statement;
e.g. Options.DefaultFilePath(Path:=wdDocumentsPath) = "Storage:A
Transfer Folder:John:", or is there a way to do this without changing
the default file path?
(2) What is the command to open the directory and wait?
(3) Right now the input box accepts a letter and when I hit return, it
executes the appropriate case. Is there a way to have the macro
execute without hitting the return?

Thanks.

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
http://jgmcghie.fastmail.com.au/
Nhulunbuy, Northern Territory, Australia
+61 4 1209 1410, mailto:[email protected]
 

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