PRJ98: How to Change the Default Working Directory

ID: Q175026


The information in this article applies to:
  • Microsoft Project 98 for Windows

IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

SUMMARY

This article describes how to change the default directory that Microsoft Project 98 uses when you open and save files.


MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft Support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp

Use either of the following two methods to change the default directory that Microsoft Project uses when you open and save files.

Method 1: Create a Macro


  1. In Microsoft Project, on the Tools menu, point to Macro, then Visual Basic Editor.


  2. In the Project Explorer, expand ProjectGlobal (Global.mpt)


  3. Expand Microsoft Project Objects.


  4. Double click ThisProject (Global.mpt).


  5. In the Code window, in the Object drop down, click Project.


  6. Between the following lines:
    
    Private Sub Project_Open(ByVal pj As MSProject.Project)
    End Sub 
    add this line:
    
    Auto_Open 


  7. On the Insert menu, click Procedure.


  8. In the Name: box, type Auto_Open.


  9. In Type, click Sub.


  10. In Scope, click Public. Click OK.


  11. Between the following lines:
    
    Public Sub Auto_Open()
    
    End Sub 
    add this line:
    
    ChDrive "c:\"  
    ChDir "c:\My Documents" 
    NOTE: c:\My Documents is the new default directory for Project. It can be replaced with an alternate folder name. Note that the drive specified for ChDrive must match the drive specified for ChDir.


  12. On the File menu, click Save Global.mpt.


  13. On the File menu, click Close and Return to Microsoft Project.


  14. In Microsoft Project, on the File menu, click Exit.



  15. Each time Microsoft Project is started, the default directory will be changed to the location specified in the macro.


Method 2: Modify the Windows Default Directory in the Registry



WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it.

NOTE: The following steps change the default working directory in Microsoft Windows. Microsoft Access, Microsoft Excel, Microsoft Power Point, and Microsoft Word allow you to use default directories other than the Windows default directory.

To set the default working directory, follow these steps:

  1. On the Windows Start menu, click Run.


  2. In the Open box, type "regedit" (without the quotation marks). Click OK.


  3. In the Registry Editor, select the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\Current Version\ Explorer\ User Shell Folders


  4. In the right pane, double-click Personal.


  5. In the Value Data box, type the path you want to use for the default working directory. For example, type "C:\My Documents" (without the quotation marks).


  6. Click OK.


  7. On the Registry menu, click Exit.


Additional query words: folder

Keywords : kbprg kbdta kbdtacode projwin
Version : WINDOWS:98
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: November 13, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.