SaveAs & ChangeFileOpenDirectory (1 Viewer)

Seeker

Registered User.
Local time
Today, 08:06
Joined
Apr 18, 2005
Messages
18
I have a document named test.doc saved in C:\one. I open that document in Word (2003). Now I want a macro that shows the SaveAs dialog defaulting to C:\two instead of C:\one. I've tried...

ChangeFileOpenDirectory "C:\two\"
Dialogs(wdDialogFileSaveAs).Show


...and...

Dialogs(wdDialogFileSaveAs).Name = "C:\two\"
Dialogs(wdDialogFileSaveAs).Show


...but those only seem to work on unsaved documents and not at all, respectively. And not that it makes a noticeable difference either way but Tools > Options > File Locations > Documents is already set to C:\two. Any suggestions? :)
 

Ziggy1

Registered User.
Local time
Today, 15:06
Joined
Feb 6, 2002
Messages
462
Look at my post here

http://forums.techguy.org/business-applications/505027-solved-word-macro-file-open.html

* go to my last post


It is not exactly the same as what you are looking for, what it does is give you theFile open dialogue already defaulted to a specific location ( alters the default set in options), Before it does that it retains the current directory so it can reset the default at the end of the code.

So after you choose the word doc (or Text) , it does some formatting and then saves it to a default directory. it is the reverse to what you are looking for but you can apply to your save dialogue.

if you have dificulty I will help you further.

to test this code you need to modify these parts to match your directories

' Note: Substitute any existing directory.
Options.DefaultFilePath(Path:=wdDocumentsPath) = "\\ServerTest"

any reference to ... C:\Reports

The formatting just changes it to landscape and changes Font and some attributes and then saves as Word doc....
 

Users who are viewing this thread

Top Bottom