Results 1 to 2 of 2
2004-01-12, 14:55 #1
- Join Date
- Dec 2003
- District Of Columbia, USA
- Thanked 0 Times in 0 Posts
Default Document location (Word2003)
I need to read the value of the default documents path in Tools, Options and have assigned a variable to Options.DefaultFilePath (wdDocumentsPath) in a VBA. The problem is that the value returned is that of the last directory accessed in File, Open; in other words, this
parameter behaves the same as wdCurrentFolderPath. Is there some other code or parameter that will return the value that is set in Options for the user's document path?
In prior versions of MSWord I could check the DOC-PATH value in the registry. However, with OfficeXP the DOC-PATH value is not always set (for example of the default documents location is My Documents).
I experimented with Dialogs(wdDialogToolsOptionsFileLocations). In the immediate window ? .Path gives 16416 and ? .Settings gives the default document value I desire. However, is this value reliable? Also, what is 16416? Will I use the .Setting value and, by mistake, get a different, unwanted, Tools, Options, File Locations value?
2004-01-12, 20:13 #2
- Join Date
- Feb 2001
- Silicon Valley, USA
- Thanked 94 Times in 90 Posts
Re: Default Document location (Word2003)
Actually, DOC-PATH is missing for Word 2000 and Word 2002, too, if the user is simply using the Windows default personal path. I think your best bet is first to check for DOC-PATH and, if that isn't found, check the Windows personal path.
Dialogs(wdDialogToolsOptionsFileLocations).Setting was a good idea. According to my Word 6 WordBasic book, though, the old WordBasic command ToolsOptionsFileLocations is a write-only statement. Using it to read could have unpredictable results. On the other hand, you might be in luck: the first .Path option listed is DOC-PATH, and a read might consistently returns this first parameter.