Starting Word with variable folder

  • Thread starter Thread starter Steve Wesner
  • Start date Start date
S

Steve Wesner

I can create a shorcut in my accounting software to
launch Word. What I would like to customize is the
default directory that opens when I launch Word. I would
like to pass a variable ie: the current customer number
in my AR to be the default directory for this specific
launch of Word. For example if I launch Word from my
accounting shortcut when I am reviewing customer 1002 I
would like the working directory for Word to be
c:\customers\1002\worddoc and if I am reviewing customer
5050 I would like to working directory for Word to be
c:\customers\5050\worddoc. Any help would be appreciated.
Thank you.
 
Hi Steve,

Can you do any automation of Word from within the accounting
software? Or does the functionality have to be on the Word
side? Is this for you, personally, or something you plan to
share/distribute? Which version of Word?
I can create a shorcut in my accounting software to
launch Word. What I would like to customize is the
default directory that opens when I launch Word. I would
like to pass a variable ie: the current customer number
in my AR to be the default directory for this specific
launch of Word. For example if I launch Word from my
accounting shortcut when I am reviewing customer 1002 I
would like the working directory for Word to be
c:\customers\1002\worddoc and if I am reviewing customer
5050 I would like to working directory for Word to be
c:\customers\5050\worddoc.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)
 
Hi Cindy,

1. The functionality needs to be on the Word side, the
only thing I can do is create a button to launch Word
from the accounting application. What I hope to do is to
pass the customer number variable to the launch script to
set the default folder.

2. This is for me and my employees use only.

3. We are currently using Word 2000, however, I would
hope that whatever solution can be developed would
migrate to later versions.

Thanks,

Steve
 
Steve,

This all very much do-able.

Word supports startup switches. Search Help for "start-up" switches. I
guess what I would do is call Word with the "/m" switch which tells it
to run a macro. that macro would be named the "customer number". Inside
Word would be a macro with the name equivalent the customer number. The
macro would change the default directory with the
Options.DefaultFilePath command using the logic/design you describe below.

Since a macro is being launched, then you can do pretty much anything
you want.

The macro would be distribued to users in a template.
 
Hi Rob,

Fine... but how is the macro you envision going to pick up the customer
number from the accounting form?
Word supports startup switches. Search Help for "start-up" switches. I
guess what I would do is call Word with the "/m" switch which tells it
to run a macro. that macro would be named the "customer number". Inside
Word would be a macro with the name equivalent the customer number. The
macro would change the default directory with the
Options.DefaultFilePath command using the logic/design you describe below.

Since a macro is being launched, then you can do pretty much anything
you want.

The macro would be distribued to users in a template.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
Hi Steve,
1. The functionality needs to be on the Word side, the
only thing I can do is create a button to launch Word
from the accounting application. What I hope to do is to
pass the customer number variable to the launch script to
set the default folder.
Since the accounting application isn't able to automate
Word, does it provide any way for Word automation to pick up
the customer number from it? You talk in your first message
about "passing the customer number as a variable", but is
this software capable of doing that?

If not, then would it be acceptable to you to have the Word
macro prompt for the number, and the user type it in?

Also: You talk about this being the "active directory". Do
you mean "active" in that you want File/Open to go there? As
well as File/Save? Would you primarily be planning to write
new documents (what kind)? Or open existing ones?

Since this is to be for more than one person, are these
folders likely to be network drives? Or will they be local?
2. This is for me and my employees use only.

3. We are currently using Word 2000, however, I would
hope that whatever solution can be developed would
migrate to later versions.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)
 
The macro is *named* the customer number, e.g.

winword /m c1202031

where c1202031 is customer name. Macro must start with letter as this
required by Word. calling program has to construct this call. Steve
said "What I hope to do is to
pass the customer number variable to the launch script to
set the default folder" ... while this is not confirmation this is
possible, this is the basis of the suggestion.

a constructed call required and if not possible in calling program, then
another approach req'd and for that I don't have enough info about their
other application to make wise choices!. I think that this also has to
be more carefully thought through as a development project since they
have to think about how this will be maintained, e.g. adding/deleteing
customers changes the macros and all that. It may will be all too
complicated given the limitations on the calling programs side.
 
Hi Rob,
The macro is *named* the customer number, e.g.

winword /m c1202031

where c1202031 is customer name.
A thousand customers, a thousand shortcuts, to a thousand
macros? <shudder>

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)
 
Cindy said:
Hi Rob,



A thousand customers, a thousand shortcuts, to a thousand
macros? <shudder>

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)

Yes .. agreed. But if they want it and that's the only way due to
limitations in calling program, and limitations in Word to receiving a
"variable" send to a macro ...
 
Back
Top