Hi epuglise!
You wrote that...
>>'the problem is that the ..\ doesn't make the change directory thing go "up"
>>
>> ChangeFileOpenDirectory "..\" & PROJECTFOLDER & "\"
But I am a little confused because the ".." (in fact your entire line) DOES work when I try it.
So I'm trying to think of reasons that it might not be working for you.
One possibility:
at the time that this line of code in this macro is trying to run, are you assuming that the folder that Word is in is the default document-saving folder? For example, are you assuming that Word is in:
C:\Documents and Settings\User1\My Documents\SaveThemHere
and you expect your line of code to switch to:
C:\Documents and Settings\User1\My Documents\PROJECTFOLDER
(is that more or less a correct description of your situation?)
Because you may encounter problems if word is not "in" the folder you think it is.
To investigate this, you might try adding some lines immediately before the line with
ChangeFileOpenDirectory
you could add:
Debug.Print CurDir
Debug.Print Options.DefaultFilePath(wd
or:
MsgBox CurDir
MsgBox Options.DefaultFilePath(wd
(if you use Debug.Print you must have the "immediate window" open -- i think ctrl+g will open it)
So if you expect and NEED word to be "in" the typical/default saveas folder before the code in this macro can run properly, then add something like this to the macro:
ChangeFileOpenDirectory Options.DefaultFilePath(wd
Main Topics
Browse All Topics





by: gilbarPosted on 2004-09-16 at 12:51:55ID: 12078556
i'm not sure how'd you do this without the whole path, but if you do use the whole path, the changefileopendirectory statement should set the current directory to what you want.