default filepath in XP

Z

zSplash

In Word 2k, the following code successfully "set" the default filepath:
Options.DefaultFilePath(Path:=wdUserTemplatesPath)="C:\Documents and
Settings\username\Application Data\Microsoft\Templates"

Now, in Word XP, this code results in an error:
Run-time error 4101
Illegal function call

If I use the macro recorder, to "set" the same path, I am unsuccessful
(won't let me select this folder), but if I use the macro recorder to "set"
the path to "C:\" , I am successful, and then g0don't get the error on
running the sub. Is there some different kind of permissions structure for
XP files for my chosen filepath in XP, or else what's the deal, guys?

TIA
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < zSplash > écrivait :
In this message, < zSplash > wrote:

|| In Word 2k, the following code successfully "set" the default filepath:
|| Options.DefaultFilePath(Path:=wdUserTemplatesPath)="C:\Documents and
|| Settings\username\Application Data\Microsoft\Templates"
||
|| Now, in Word XP, this code results in an error:
|| Run-time error 4101
|| Illegal function call
||
|| If I use the macro recorder, to "set" the same path, I am unsuccessful
|| (won't let me select this folder), but if I use the macro recorder to
"set"
|| the path to "C:\" , I am successful, and then g0don't get the error on
|| running the sub. Is there some different kind of permissions structure
for
|| XP files for my chosen filepath in XP, or else what's the deal, guys?
||

Works OK here (I pasted your code in a Word XP module).
Are you sure you did not forget to change "username" for the actual name?
Just checking... you never know! I have done much dumber mistakes!
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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