Options.DefaultFilePath(wdUserOptionsPath)

H

Howard Kaikow

Where's the documentation for the meaning of wdUserOptionsPath?
Al I see in the Help is the existence of the option, but no semantics.

Using Word 2003, I see the following behavior.

Depending on whether I run code directly from VBA or via automation in VB 6,
I get entirely different critters.
As I recall, I've see 3 different results, depending on how the code was
run.

1. ":\documents and settings\howard kaikow\application
data\microsoft\templates\templates2003", i.e., the directory in which the
Word template lives, when run in VBA.
2. :\WinNT\System32, when run in VB 6 design window or from a VB 6 compiled
..exe file.
3. My Documents, I saw this yesterday, but do not recall how the code was
run, as I recall it was in VBA.

All the other DefaultFilePath results are the same, no matter how I run the
code, other than wdUserOptionsPath and, as expected, wdCurrentFolderPath.

I would think that wdUserOptionsPath should refer to the same directory no
matter how the code is run.
 
J

Jezebel

I don't have any inside knowledge on this, but my understanding is if the
value hasn't been set (through code or through Options > File locations), it
simply returns the current folder.

That's certainly the case on my machine for wdUserOptionsPath. Just testing
it in the immediate window, it returns the same as wdCurrentFolderPath --
namely whatever folder that is displayed if you bring up the File > Open
dialog. (Hence your MyDocuments result?) Open a file from another folder and
the return value changes to that folder. VB and VBA have their own ideas
about Word's current folder.
 
H

Howard Kaikow

The VB 6 .exe file is being run from "D:\Visual Basic
Code\WordSettings\WordSettingsEXE" and returns x:\winnt\system32.
This is an odd result because VB 6 usually chooses "X:\Program
Files\Microsoft Visual Studio\VB98"

Where x is the drive letter of the system drive. This is a multiboot system,
so X changes for each Office version.

As I recall, the VBA version returns either MY Documents or the Template
directory.
I forget the circumstances.
--
http://www.standards.com/; See Howard Kaikow's web site.
Jezebel said:
I don't have any inside knowledge on this, but my understanding is if the
value hasn't been set (through code or through Options > File locations), it
simply returns the current folder.

That's certainly the case on my machine for wdUserOptionsPath. Just testing
it in the immediate window, it returns the same as wdCurrentFolderPath --
namely whatever folder that is displayed if you bring up the File > Open
dialog. (Hence your MyDocuments result?) Open a file from another folder and
the return value changes to that folder. VB and VBA have their own ideas
about Word's current folder.




Howard Kaikow said:
Where's the documentation for the meaning of wdUserOptionsPath?
Al I see in the Help is the existence of the option, but no semantics.

Using Word 2003, I see the following behavior.

Depending on whether I run code directly from VBA or via automation in
VB
 

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