J
Jason McCleskey
We have a problem in using Word macros on some PC's where
the environment variables being picked up by the macros
are different on some PC's. Process is we have a sales
system that writes out delimited file with address info
etc... into the %TEMP% directory on the PC and then
executes Word with a specific template/macro to process
that file. The Word macro reads the file out of the %
TEMP% directory and builds the letter. At a global
system level the %TEMP% environment variable is set to
C:\Temp. However when running inside of our sales system
the %TEMP% environment variable is set to
C:\username\temp (set by a batch file that starts the
sales system up and sets a bunch of environment
variables). We are using Word 2002 SP-2 on Windows XP SP-
1 on all of the machines in question.
Problem is that on the PC's that work correctly the macro
is reading %TEMP% (OPEN ENVIRON("TEMP")+"\filename.txt")
as C:\username\temp. But on the PC's that are not
working the macro is reading %TEMP% as C:\temp. The
macro in that instance is not picking up the environment
variables from the session that launched Word/macro. In
both cases Word is being launched in the same manner
using the same template/same macro.
Question is: Is there a way to control (macro/template
setting?) what environment variables are being used when
a Word Macro is executed? Why would the global system
level environ variables be used on one PC while the sales
system session level environ variables be used in on
another?
the environment variables being picked up by the macros
are different on some PC's. Process is we have a sales
system that writes out delimited file with address info
etc... into the %TEMP% directory on the PC and then
executes Word with a specific template/macro to process
that file. The Word macro reads the file out of the %
TEMP% directory and builds the letter. At a global
system level the %TEMP% environment variable is set to
C:\Temp. However when running inside of our sales system
the %TEMP% environment variable is set to
C:\username\temp (set by a batch file that starts the
sales system up and sets a bunch of environment
variables). We are using Word 2002 SP-2 on Windows XP SP-
1 on all of the machines in question.
Problem is that on the PC's that work correctly the macro
is reading %TEMP% (OPEN ENVIRON("TEMP")+"\filename.txt")
as C:\username\temp. But on the PC's that are not
working the macro is reading %TEMP% as C:\temp. The
macro in that instance is not picking up the environment
variables from the session that launched Word/macro. In
both cases Word is being launched in the same manner
using the same template/same macro.
Question is: Is there a way to control (macro/template
setting?) what environment variables are being used when
a Word Macro is executed? Why would the global system
level environ variables be used on one PC while the sales
system session level environ variables be used in on
another?