Change directory in Macro Savefile
Posted on 2004-09-16
Ok, I got this to work once, but now it won't work. Please help.
I want this macro to save a file in a "peer" folder... that is, I need the save function to go up one directory and back down to another. I would like to avoid using the entire path, but I will if necessary...
Here's some code. A quick response (before 5pm) is an extra 100 points.
Dim CurrDocName, CurrDocPath
CurrDocName = ActiveDocument.Name
CurrDocPath = ActiveDocument.Path
'Save the "Clean" Version of the CurrentDoc
'PROJECTFOLDER is a folder name declared elsewhere...
'the problem is that the ..\ doesn't make the change directory thing go "up"
ChangeFileOpenDirectory "..\" & PROJECTFOLDER & "\"
ActiveDocument.SaveAs FileName:="T_" & CurrDocName
'Now save the redline version of the current doc, before we create the redlines...
ChangeFileOpenDirectory "..\" & REDLINEFOLDER & "\"
ActiveDocument.SaveAs FileName:="R_" & CurrDocName
'Now make the redlines
ActiveDocument.Compare Name:="..\" & ENABLERfolder & "\" & CurrDocName
'And save them