Link to home
Start Free TrialLog in
Avatar of PMRTech
PMRTech

asked on

Can I force Word 2007 "Save As" to the default file location?

Is there a way to force Word 2007, when doing a "Save As", to go to the "default file location" that we specified in the Word options?

It appears Word 2007 tries to go to the same location from which the file came when doing a "Save As" which could be something different.

We have a Web server running IIS 6.0 that hosts some Word files that are read only.  When we open a file in the browser, it starts up Word and opens it just fine.  However, when we do a "Save As" a window pops up for user credentials so it can save it back on the Web server.  If we cancel that window, then the "Save As" window goes to our "default file location".

I want to force it to the default location to eliminate the pop up window.  

Note:  This does NOT happen with our older version of Word XP (2002).
Avatar of Xcone
Xcone
Flag of Netherlands image

There's no way to force it using the settings of Word. But you can do it using a Macro. See the attached code.

This code should be part of an Word-template (*.Dot) and must me loaded as an addin. The easiest way to do that, is to find the Word Startup folder and add the template in that folder. It will load as an addin automaticly when Word starts. Open de VBA macro editor (Tools > Macro > Editor / or press Alt + F11). Find your template, in the treeview and add a module. Add the attached code in this module and save it. Make sure you replace "<MyDefaultLocation>" with the filefolder you wish to save as default.
Sub FileSaveAs()
  ShowSaveDialog "<MyDefaultLocation>"
End Sub
 
Function ShowSaveDialog(Optional ByVal AFileName As String = "") As Boolean
  Dim d As Dialog
  
  Set d = Dialogs(wdDialogFileSaveAs)
  d.Name = AFileName
  
  On Error GoTo Except
  ShowSaveDialog = (d.Show = -1)
  
  Exit Function
Except:
  MsgBox Err.Description, vbExclamation
End Function

Open in new window

I'm sorry, I forgot to mention how it works. The macro called "FileSaveAs" is recognized by Word as an overload. So instead of calling the default SaveAs of Word, the macro "FileSaveAs" will be called instead. So no other steps are required, other then making this macro available in a public module of an addin.
ASKER CERTIFIED SOLUTION
Avatar of Xcone
Xcone
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial